<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Me, mysql and php</title>
	<atom:link href="http://maraz.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://maraz.org</link>
	<description></description>
	<pubDate>Sat, 28 Feb 2009 17:54:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Zend Framework &#038; ExtJS Grid - part 1</title>
		<link>http://maraz.org/2008/07/24/zend-framework-extjs-grid-part-1/</link>
		<comments>http://maraz.org/2008/07/24/zend-framework-extjs-grid-part-1/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 16:28:19 +0000</pubDate>
		<dc:creator>silvester</dc:creator>
		
		<category><![CDATA[All]]></category>

		<category><![CDATA[Extjs]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://maraz.org/?p=24</guid>
		<description><![CDATA[The old way to make a grid was very time consuming. Basically it is just copy paste but still there is a lot to rewrite. You have to take care of the actions, pager and maybe a filter.
So i tried ext js grid. Since extjs renders the grid alone and looks a lot better then [...]]]></description>
			<content:encoded><![CDATA[<p>The old way to make a grid was very time consuming. Basically it is just copy paste but still there is a lot to rewrite. You have to take care of the actions, pager and maybe a filter.</p>
<p>So i tried ext js grid. Since extjs renders the grid alone and looks a lot better then my grids which are done with smarty, html table and css.<br />
<span id="more-24"></span><br />
A good grid should</p>
<ul>
<li>Paginate</li>
<li>Filter</li>
<li>Sort</li>
<li>Edit ??? (maybe)</li>
</ul>
<p>To make an extjs grid you need 3 pieces of code. Store, Columns and the Grid its self. Since Zend framework DB model component has some information we can use, I tried to automate a piece of it.</p>
<p>Not to forget, you have to create models for the tables that you want to use. The extended zend_db_table will create a .js file for us which includes the store and the columns model for our grid. After the file is created we can manually edit and change it to fit our needs, like hiding some columns or different formating.</p>
<h3>The Store</h3>
<p>I also extended the zend_db_rowset to return json data for its rowset, so i do use the Ext.data.JsonStore. it looks like this.</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4b9ce73294450">
<div class="synthi_header" style="font-weight:bold;"> JAVASCRIPT <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4b9ce73294450').style.display='block';document.getElementById('plain_synthi_4b9ce73294450').style.display='none';return false">Show Styled Code</a>]:</span></div>
<pre style="width:100%;overflow:auto;">var xmlStore = new Ext.data.JsonStore({
	url: '/some/index/xml-list/', // here we have an action in some module, index controller
	fields: xml_st, // created via zend_db_table
	totalProperty: 'count', // calculated from zend_db_table
	root: 'xml' // allways the table name, xml here is not the output format!!!
});</pre>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4b9ce73294450">
<div class="synthi_header" style="font-weight:bold;"> JAVASCRIPT <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4b9ce73294450').style.display='block';document.getElementById('styled_synthi_4b9ce73294450').style.display='none';return false">Show Plain Code</a>]:</span></div>
<div class="javascript" style="font-family: monospace;">
<ol>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> xmlStore = <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #006600;">data</span>.<span style="color: #006600;">JsonStore</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; url: <span style="color: #3366CC;">&#8216;/some/index/xml-list/&#8217;</span>, <span style="color: #009900; font-style: italic;">// here we have an action in some module, index controller</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; fields: xml_st, <span style="color: #009900; font-style: italic;">// created via zend_db_table</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; totalProperty: <span style="color: #3366CC;">&#8216;count&#8217;</span>, <span style="color: #009900; font-style: italic;">// calculated from zend_db_table</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; root: <span style="color: #3366CC;">&#8216;xml&#8217;</span> <span style="color: #009900; font-style: italic;">// allways the table name, xml here is not the output format!!!</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
<p>Now the created fields from zend_db_table. Also not to forget we have to include the created files from zend_db_table.</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4b9ce732a17d7">
<div class="synthi_header" style="font-weight:bold;"> JAVASCRIPT <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4b9ce732a17d7').style.display='block';document.getElementById('plain_synthi_4b9ce732a17d7').style.display='none';return false">Show Styled Code</a>]:</span></div>
<pre style="width:100%;overflow:auto;">// this is created from zend_db_table.
var xml_st = [
	{name: 'xml_id', type: 'int'},
	{name: 'created_on', type: 'date', dateFormat: 'Y-m-d H:i:s'},
	{name: 'updated_on', type: 'date', dateFormat: 'Y-m-d H:i:s'},
	{name: 'xml_name', type: 'string'},
	{name: 'xml_description', type: 'string'},
	{name: 'status', type: 'int'}
];</pre>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4b9ce732a17d7">
<div class="synthi_header" style="font-weight:bold;"> JAVASCRIPT <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4b9ce732a17d7').style.display='block';document.getElementById('styled_synthi_4b9ce732a17d7').style.display='none';return false">Show Plain Code</a>]:</span></div>
<div class="javascript" style="font-family: monospace;">
<ol>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// this is created from zend_db_table.</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> xml_st = <span style="color: #66cc66;">&#91;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><span style="color: #000066;">name</span>: <span style="color: #3366CC;">&#8216;xml_id&#8217;</span>, type: <span style="color: #3366CC;">&#8216;int&#8217;</span><span style="color: #66cc66;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><span style="color: #000066;">name</span>: <span style="color: #3366CC;">&#8216;created_on&#8217;</span>, type: <span style="color: #3366CC;">&#8216;date&#8217;</span>, dateFormat: <span style="color: #3366CC;">&#8216;Y-m-d H:i:s&#8217;</span><span style="color: #66cc66;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><span style="color: #000066;">name</span>: <span style="color: #3366CC;">&#8216;updated_on&#8217;</span>, type: <span style="color: #3366CC;">&#8216;date&#8217;</span>, dateFormat: <span style="color: #3366CC;">&#8216;Y-m-d H:i:s&#8217;</span><span style="color: #66cc66;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><span style="color: #000066;">name</span>: <span style="color: #3366CC;">&#8216;xml_name&#8217;</span>, type: <span style="color: #3366CC;">&#8217;string&#8217;</span><span style="color: #66cc66;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><span style="color: #000066;">name</span>: <span style="color: #3366CC;">&#8216;xml_description&#8217;</span>, type: <span style="color: #3366CC;">&#8217;string&#8217;</span><span style="color: #66cc66;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><span style="color: #000066;">name</span>: <span style="color: #3366CC;">&#8217;status&#8217;</span>, type: <span style="color: #3366CC;">&#8216;int&#8217;</span><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#93;</span>; </div>
</li>
</ol>
</div>
</div>
<p>Because we have the information of the field from mysql and zend_db_table we can create this file. So if you would need some more improvement you could edit the created file and add some more meta data.</p>
<h3>The Column Model</h3>
<p>We can also create some basic information about the columns with the meta data from mysql for the table.</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4b9ce732baa22">
<div class="synthi_header" style="font-weight:bold;"> JAVASCRIPT <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4b9ce732baa22').style.display='block';document.getElementById('plain_synthi_4b9ce732baa22').style.display='none';return false">Show Styled Code</a>]:</span></div>
<pre style="width:100%;overflow:auto;">// this is created from zend_db_table
var xml_cm = [
	{header: 'xml_id', dataIndex: 'xml_id', id: 'xml_id', resizeable: true, sortable: true, align: 'right'},
	{header: 'created_on', dataIndex: 'created_on', id: 'created_on', resizeable: true, sortable: true, renderer: Ext.util.Format.dateRenderer('d.m.Y')},
	{header: 'updated_on', dataIndex: 'updated_on', id: 'updated_on', resizeable: true, sortable: true, renderer: Ext.util.Format.dateRenderer('d.m.Y')},
	{header: 'xml_name', dataIndex: 'xml_name', id: 'xml_name', resizeable: true, sortable: true},
	{header: 'xml_description', dataIndex: 'xml_description', id: 'xml_description', resizeable: true, sortable: true},
	{header: 'status', dataIndex: 'status', id: 'status', resizeable: true, sortable: true, hidden: true}
];</pre>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4b9ce732baa22">
<div class="synthi_header" style="font-weight:bold;"> JAVASCRIPT <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4b9ce732baa22').style.display='block';document.getElementById('styled_synthi_4b9ce732baa22').style.display='none';return false">Show Plain Code</a>]:</span></div>
<div class="javascript" style="font-family: monospace;">
<ol>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// this is created from zend_db_table</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> xml_cm = <span style="color: #66cc66;">&#91;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span>header: <span style="color: #3366CC;">&#8216;xml_id&#8217;</span>, dataIndex: <span style="color: #3366CC;">&#8216;xml_id&#8217;</span>, id: <span style="color: #3366CC;">&#8216;xml_id&#8217;</span>, resizeable: <span style="color: #003366; font-weight: bold;">true</span>, sortable: <span style="color: #003366; font-weight: bold;">true</span>, align: <span style="color: #3366CC;">&#8216;right&#8217;</span><span style="color: #66cc66;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span>header: <span style="color: #3366CC;">&#8216;created_on&#8217;</span>, dataIndex: <span style="color: #3366CC;">&#8216;created_on&#8217;</span>, id: <span style="color: #3366CC;">&#8216;created_on&#8217;</span>, resizeable: <span style="color: #003366; font-weight: bold;">true</span>, sortable: <span style="color: #003366; font-weight: bold;">true</span>, renderer: Ext.<span style="color: #006600;">util</span>.<span style="color: #006600;">Format</span>.<span style="color: #006600;">dateRenderer</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;d.m.Y&#8217;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span>header: <span style="color: #3366CC;">&#8216;updated_on&#8217;</span>, dataIndex: <span style="color: #3366CC;">&#8216;updated_on&#8217;</span>, id: <span style="color: #3366CC;">&#8216;updated_on&#8217;</span>, resizeable: <span style="color: #003366; font-weight: bold;">true</span>, sortable: <span style="color: #003366; font-weight: bold;">true</span>, renderer: Ext.<span style="color: #006600;">util</span>.<span style="color: #006600;">Format</span>.<span style="color: #006600;">dateRenderer</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;d.m.Y&#8217;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span>header: <span style="color: #3366CC;">&#8216;xml_name&#8217;</span>, dataIndex: <span style="color: #3366CC;">&#8216;xml_name&#8217;</span>, id: <span style="color: #3366CC;">&#8216;xml_name&#8217;</span>, resizeable: <span style="color: #003366; font-weight: bold;">true</span>, sortable: <span style="color: #003366; font-weight: bold;">true</span><span style="color: #66cc66;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span>header: <span style="color: #3366CC;">&#8216;xml_description&#8217;</span>, dataIndex: <span style="color: #3366CC;">&#8216;xml_description&#8217;</span>, id: <span style="color: #3366CC;">&#8216;xml_description&#8217;</span>, resizeable: <span style="color: #003366; font-weight: bold;">true</span>, sortable: <span style="color: #003366; font-weight: bold;">true</span><span style="color: #66cc66;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span>header: <span style="color: #3366CC;">&#8217;status&#8217;</span>, dataIndex: <span style="color: #3366CC;">&#8217;status&#8217;</span>, id: <span style="color: #3366CC;">&#8217;status&#8217;</span>, resizeable: <span style="color: #003366; font-weight: bold;">true</span>, sortable: <span style="color: #003366; font-weight: bold;">true</span>, hidden: <span style="color: #003366; font-weight: bold;">true</span><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#93;</span>; </div>
</li>
</ol>
</div>
</div>
<p>In this example i added the information about hidden:true. You can still change some other setting.</p>
<h3>The Grid</h3>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4b9ce732ef5d1">
<div class="synthi_header" style="font-weight:bold;"> JAVASCRIPT <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4b9ce732ef5d1').style.display='block';document.getElementById('plain_synthi_4b9ce732ef5d1').style.display='none';return false">Show Styled Code</a>]:</span></div>
<pre style="width:100%;overflow:auto;">// this is all we have to write to make a basic grid
var xmlGrid = new Ext.grid.GridPanel({
	renderTo: 'xml_div',
	title: 'XML',
	store: xmlStore,
	columns: xml_cm, // the created column model
	stripeRows: true,
	border: true,
	frame: true
});</pre>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4b9ce732ef5d1">
<div class="synthi_header" style="font-weight:bold;"> JAVASCRIPT <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4b9ce732ef5d1').style.display='block';document.getElementById('styled_synthi_4b9ce732ef5d1').style.display='none';return false">Show Plain Code</a>]:</span></div>
<div class="javascript" style="font-family: monospace;">
<ol>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// this is all we have to write to make a basic grid</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> xmlGrid = <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #006600;">grid</span>.<span style="color: #006600;">GridPanel</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; renderTo: <span style="color: #3366CC;">&#8216;xml_div&#8217;</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; title: <span style="color: #3366CC;">&#8216;XML&#8217;</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; store: xmlStore,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; columns: xml_cm, <span style="color: #009900; font-style: italic;">// the created column model</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; stripeRows: <span style="color: #003366; font-weight: bold;">true</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; border: <span style="color: #003366; font-weight: bold;">true</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; frame: <span style="color: #003366; font-weight: bold;">true</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
<p>So this would be the basic grid. in next series we also are going to add the pager, grouping, filter and maybe some other stuff and demonstrate how it work together with zend_framework.</p>
<h3>The PHP Part</h3>
<p>This is the basic extend for the zend_db_table. If you do not want to use this class you can use (copy &amp; paste) the code. I do not need any credits.</p>
<p>We have here to function one of them is getCount(). This function hepls us to get the count for the rowset object and the information is also used for the pager.</p>
<p>extWriteGridSettings(), will write a .js file for its model. So if you have a model called xml it will write xml_gs.js to the folder which you set (GridSettings).</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4b9ce7330dc7b">
<div class="synthi_header" style="font-weight:bold;"> PHP <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4b9ce7330dc7b').style.display='block';document.getElementById('plain_synthi_4b9ce7330dc7b').style.display='none';return false">Show Styled Code</a>]:</span></div>
<pre style="width:100%;overflow:auto;">getAdapter()-&gt;fetchOne(&#034;select count(*) as count from {$this-&gt;_name} where $where&#034;);
		} else {
			$count = $this-&gt;getAdapter()-&gt;fetchOne(&#034;select count(*) as count from {$this-&gt;_name}&#034;);
		}

		return $count;

	}

	public function extWriteGridSettings() // write some settings
	{

		$cm = &#034;var {$this-&gt;_name}_cm = [\n&#034;;
		$st = &#034;var {$this-&gt;_name}_st = [\n&#034;;

		foreach($this-&gt;_metadata as $index =&gt; $arr) { // the metadata

			switch($arr['DATA_TYPE']) {
				case 'int':
					$type = 'int';
					$cmExtra = &#034;, align: 'right'&#034;;
					break;
				case 'mediumint':
					$type = 'int';
					$cmExtra = &#034;, align: 'right'&#034;;
					break;
				case 'timestamp':
					$type = 'date';
					$stExtra = &#034;, dateFormat: 'Y-m-d H:i:s'&#034;;
					$cmExtra = &#034;, renderer: Ext.util.Format.dateRenderer('d.m.Y')&#034;;
					break;
				case 'decimal':
					$type = 'auto';
					$cmExtra = &#034;, align: 'right', renderer: Ext.util.Format.Currency&#034;;
					break;
				case 'varchar':
					$type = 'string';
					break;
				case 'tinyint':
					$type = 'int';
					break;
				case 'text':
					$type = 'string';
					break;
				default:
					$type = 'auto';
					break;
			}

			if(strlen($this-&gt;sortables[$index]) &gt; 0) {
				$cmArr[] = &#034;\n\t{header: '{$this-&gt;sortables[$index]}', dataIndex: '$index', id: '$index', resizeable: true, sortable: true{$cmExtra}}&#034;;
			} else {
				$cmArr[] = &#034;\n\t{header: '$index', dataIndex: '$index', id: '$index', resizeable: true, sortable: true{$cmExtra}}&#034;;
			}

			$stArr[] = &#034;\n\t{name: '$index', type: '$type'$stExtra}&#034;;

			$type = '';
			$stExtra = '';
			$cmExtra = '';

		}

		$cm .= implode(', ', $cmArr).&#034;\n\n];\n\n&#034;;
		$st .= implode(', ', $stArr).&#034;\n\n];&#034;;

		$cf = Zend_Registry::get('config');

		$fp = fopen($cf-&gt;path-&gt;file.'pub/js/ext-cache/'.$this-&gt;_name.'_gs.js', 'a'); // write where ever you wish

		fwrite($fp, $cm.$st);

		fclose($fp);

		chmod($cf-&gt;path-&gt;file.'pub/js/ext-cache/'.$this-&gt;_name.'_gs.js', 0777);

	}

}</pre>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4b9ce7330dc7b">
<div class="synthi_header" style="font-weight:bold;"> PHP <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4b9ce7330dc7b').style.display='block';document.getElementById('styled_synthi_4b9ce7330dc7b').style.display='none';return false">Show Plain Code</a>]:</span></div>
<div class="php" style="font-family: monospace;">
<ol>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">getAdapter<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>-&amp;gt;fetchOne<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;select count(*) as count from {$this-&amp;gt;_name} where $where&quot;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$count</span> = <span style="color: #0000ff;">$this</span>-&amp;gt;getAdapter<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>-&amp;gt;fetchOne<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;select count(*) as count from {$this-&amp;gt;_name}&quot;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$count</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; public <span style="color: #000000; font-weight: bold;">function</span> extWriteGridSettings<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">// write some settings</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$cm</span> = <span style="color: #ff0000;">&quot;var {$this-&amp;gt;_name}_cm = [<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$st</span> = <span style="color: #ff0000;">&quot;var {$this-&amp;gt;_name}_st = [<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$this</span>-&amp;gt;_metadata <span style="color: #b1b100;">as</span> <span style="color: #0000ff;">$index</span> =&amp;gt; <span style="color: #0000ff;">$arr</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #808080; font-style: italic;">// the metadata</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">switch</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$arr</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'DATA_TYPE'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'int'</span>:</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$type</span> = <span style="color: #ff0000;">'int'</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$cmExtra</span> = <span style="color: #ff0000;">&quot;, align: 'right'&quot;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'mediumint'</span>:</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$type</span> = <span style="color: #ff0000;">'int'</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$cmExtra</span> = <span style="color: #ff0000;">&quot;, align: 'right'&quot;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'timestamp'</span>:</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$type</span> = <span style="color: #ff0000;">'date'</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$stExtra</span> = <span style="color: #ff0000;">&quot;, dateFormat: 'Y-m-d H:i:s'&quot;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$cmExtra</span> = <span style="color: #ff0000;">&quot;, renderer: Ext.util.Format.dateRenderer('d.m.Y')&quot;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'decimal'</span>:</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$type</span> = <span style="color: #ff0000;">'auto'</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$cmExtra</span> = <span style="color: #ff0000;">&quot;, align: 'right', renderer: Ext.util.Format.Currency&quot;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'varchar'</span>:</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$type</span> = <span style="color: #ff0000;">'string'</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'tinyint'</span>:</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$type</span> = <span style="color: #ff0000;">'int'</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'text'</span>:</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$type</span> = <span style="color: #ff0000;">'string'</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">default</span>:</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$type</span> = <span style="color: #ff0000;">'auto'</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/strlen"><span style="color: #000066;">strlen</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$this</span>-&amp;gt;sortables<span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$index</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> &amp;gt; <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$cmArr</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span>{header: '{$this-&amp;gt;sortables[$index]}&#8217;, dataIndex: &#8216;$index&#8217;, id: &#8216;$index&#8217;, resizeable: true, sortable: true{$cmExtra}}&quot;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$cmArr</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span>{header: &#8216;$index&#8217;, dataIndex: &#8216;$index&#8217;, id: &#8216;$index&#8217;, resizeable: true, sortable: true{$cmExtra}}&quot;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$stArr</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span>{name: &#8216;$index&#8217;, type: &#8216;$type&#8217;$stExtra}&quot;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$type</span> = <span style="color: #ff0000;">&#8221;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$stExtra</span> = <span style="color: #ff0000;">&#8221;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$cmExtra</span> = <span style="color: #ff0000;">&#8221;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$cm</span> .= <a href="http://www.php.net/implode"><span style="color: #000066;">implode</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;, &#8216;</span>, <span style="color: #0000ff;">$cmArr</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>];<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$st</span> .= <a href="http://www.php.net/implode"><span style="color: #000066;">implode</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;, &#8216;</span>, <span style="color: #0000ff;">$stArr</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>];&quot;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$cf</span> = Zend_Registry::<span style="color: #006600;">get</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;config&#8217;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$fp</span> = <a href="http://www.php.net/fopen"><span style="color: #000066;">fopen</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$cf</span>-&amp;gt;path-&amp;gt;file.<span style="color: #ff0000;">&#8216;pub/js/ext-cache/&#8217;</span>.<span style="color: #0000ff;">$this</span>-&amp;gt;_name.<span style="color: #ff0000;">&#8216;_gs.js&#8217;</span>, <span style="color: #ff0000;">&#8216;a&#8217;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// write where ever you wish</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/fwrite"><span style="color: #000066;">fwrite</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$fp</span>, <span style="color: #0000ff;">$cm</span>.<span style="color: #0000ff;">$st</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/fclose"><span style="color: #000066;">fclose</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$fp</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/chmod"><span style="color: #000066;">chmod</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$cf</span>-&amp;gt;path-&amp;gt;file.<span style="color: #ff0000;">&#8216;pub/js/ext-cache/&#8217;</span>.<span style="color: #0000ff;">$this</span>-&amp;gt;_name.<span style="color: #ff0000;">&#8216;_gs.js&#8217;</span>, <span style="color: #cc66cc;">0777</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
<p>All of my models extend the reverse_db_table so i have allways the functions. Just use once $model-&gt;extWriteGridSettings(); and it will write it do disk.</p>
<p>Now the rowset extend.</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4b9ce7358b363">
<div class="synthi_header" style="font-weight:bold;"> PHP <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4b9ce7358b363').style.display='block';document.getElementById('plain_synthi_4b9ce7358b363').style.display='none';return false">Show Styled Code</a>]:</span></div>
<pre style="width:100%;overflow:auto;">_table-&gt;getCount($where);

		$count = 0;
		foreach($this-&gt;_data as $key =&gt; $value) {
			$arr[$this-&gt;_table-&gt;info('name')][$count] = $value;
			$count++;
		}

		if($count == 0) {
			$arr[$this-&gt;_table-&gt;info('name')];
		}

		return Zend_Json::encode($arr);

	}

}</pre>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4b9ce7358b363">
<div class="synthi_header" style="font-weight:bold;"> PHP <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4b9ce7358b363').style.display='block';document.getElementById('styled_synthi_4b9ce7358b363').style.display='none';return false">Show Plain Code</a>]:</span></div>
<div class="php" style="font-family: monospace;">
<ol>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">_table-&amp;gt;getCount<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$where</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$count</span> = <span style="color: #cc66cc;">0</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$this</span>-&amp;gt;_data <span style="color: #b1b100;">as</span> <span style="color: #0000ff;">$key</span> =&amp;gt; <span style="color: #0000ff;">$value</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$arr</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$this</span>-&amp;gt;_table-&amp;gt;info<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;name&#8217;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$count</span><span style="color: #66cc66;">&#93;</span> = <span style="color: #0000ff;">$value</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$count</span>++;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$count</span> == <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$arr</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$this</span>-&amp;gt;_table-&amp;gt;info<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;name&#8217;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> Zend_Json::<span style="color: #006600;">encode</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$arr</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
<p>Now some usage examples.</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4b9ce735b9a09">
<div class="synthi_header" style="font-weight:bold;"> PHP <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4b9ce735b9a09').style.display='block';document.getElementById('plain_synthi_4b9ce735b9a09').style.display='none';return false">Show Styled Code</a>]:</span></div>
<pre style="width:100%;overflow:auto;">public function xmlListAction()
{
	$this-&gt;_autoRender = false; // my internal funciton to stop smarty from rendering
	$xmlModel = new xmls(); // the model
	$rs = $xmlModel-&gt;fetchAll();
	echo $rs-&gt;toExtJson(); // the record set
}</pre>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4b9ce735b9a09">
<div class="synthi_header" style="font-weight:bold;"> PHP <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4b9ce735b9a09').style.display='block';document.getElementById('styled_synthi_4b9ce735b9a09').style.display='none';return false">Show Plain Code</a>]:</span></div>
<div class="php" style="font-family: monospace;">
<ol>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color: #000000; font-weight: bold;">function</span> xmlListAction<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$this</span>-&amp;gt;_autoRender = <span style="color: #000000; font-weight: bold;">false</span>; <span style="color: #808080; font-style: italic;">// my internal funciton to stop smarty from rendering</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$xmlModel</span> = <span style="color: #000000; font-weight: bold;">new</span> xmls<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// the model</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$rs</span> = <span style="color: #0000ff;">$xmlModel</span>-&amp;gt;fetchAll<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #0000ff;">$rs</span>-&amp;gt;toExtJson<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// the record set</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
<p>This is a simple action in zend_controller.</p>
<p>Thats it for today. I am very sorry of my english and writing skills but i will answer the comment (maybe :-) ).</p>
]]></content:encoded>
			<wfw:commentRss>http://maraz.org/2008/07/24/zend-framework-extjs-grid-part-1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>prototype, scriptaculous Chained Select</title>
		<link>http://maraz.org/2007/05/23/prototype-scriptaculous-chained-select/</link>
		<comments>http://maraz.org/2007/05/23/prototype-scriptaculous-chained-select/#comments</comments>
		<pubDate>Wed, 23 May 2007 16:56:26 +0000</pubDate>
		<dc:creator>silvester</dc:creator>
		
		<category><![CDATA[All]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[Prototype]]></category>

		<category><![CDATA[Scriptaculous]]></category>

		<guid isPermaLink="false">http://maraz.org/2007/05/23/prototype-scriptaculous-chained-select/</guid>
		<description><![CDATA[For one of my projects i had to make some select boxes which would work in a chain. I had 500.000 inserts in mysql which should be found easily. So i implemented 5 chained select boxes. 
The first part of the project was not meant to be public so i limited my work to Firefox. [...]]]></description>
			<content:encoded><![CDATA[<p>For one of my projects i had to make some select boxes which would work in a chain. I had 500.000 inserts in mysql which should be found easily. So i implemented 5 chained select boxes. </p>
<p>The first part of the project was not meant to be public so i limited my work to Firefox. But after a while the public part started and i wanted to use some ready made widgets in smarty (like my address widget with 5 chained select boxes). When i tried it in IE 6 it did not worked.<br />
<span id="more-15"></span><br />
Here is how it looks like. The next select box will be loaded onchange of the parent select box.</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4b9ce737ef9b6">
<div class="synthi_header" style="font-weight:bold;"> HTML <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4b9ce737ef9b6').style.display='block';document.getElementById('plain_synthi_4b9ce737ef9b6').style.display='none';return false">Show Styled Code</a>]:</span></div>
<pre style="width:100%;overflow:auto;">
<select name=&#034;address[some]&#034; id=&#034;some&#034; onchange=&#034;loadSomeMore();&#034;>
       <option value=&#034;none&#034;>- - - - - - - - - - - - -</option>
</select>
</pre>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4b9ce737ef9b6">
<div class="synthi_header" style="font-weight:bold;"> HTML <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4b9ce737ef9b6').style.display='block';document.getElementById('styled_synthi_4b9ce737ef9b6').style.display='none';return false">Show Plain Code</a>]:</span></div>
<div class="html4strict" style="font-family: monospace;">
<ol>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/select.html"><span style="color: #000000; font-weight: bold;">&lt;select</span></a> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;address[some]&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;some&quot;</span> <span style="color: #000066;">onchange</span>=<span style="color: #ff0000;">&quot;loadSomeMore();&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><a href="http://december.com/html/4/element/option.html"><span style="color: #000000; font-weight: bold;">&lt;option</span></a> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;none&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>- - - - - - - - - - - - -<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/option&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/select&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4b9ce7382c443">
<div class="synthi_header" style="font-weight:bold;"> JAVASCRIPT <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4b9ce7382c443').style.display='block';document.getElementById('plain_synthi_4b9ce7382c443').style.display='none';return false">Show Styled Code</a>]:</span></div>
<pre style="width:100%;overflow:auto;">
function loadSomeMore() {
	if($F('some') != 'none') {
		var opt = {
			onSuccess: function(t) {
				Element.update('someMore', t.responseText);
			}
		}
		new Ajax.Request('/ajax/address/someMore/' + $F('some') + '/', opt);
	}
}
</pre>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4b9ce7382c443">
<div class="synthi_header" style="font-weight:bold;"> JAVASCRIPT <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4b9ce7382c443').style.display='block';document.getElementById('styled_synthi_4b9ce7382c443').style.display='none';return false">Show Plain Code</a>]:</span></div>
<div class="javascript" style="font-family: monospace;">
<ol>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> loadSomeMore<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>$F<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8217;some&#8217;</span><span style="color: #66cc66;">&#41;</span> != <span style="color: #3366CC;">&#8216;none&#8217;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> opt = <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onSuccess: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>t<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Element.<span style="color: #006600;">update</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8217;someMore&#8217;</span>, t.<span style="color: #006600;">responseText</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">new</span> Ajax.<span style="color: #006600;">Request</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;/ajax/address/someMore/&#8217;</span> + $F<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8217;some&#8217;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #3366CC;">&#8216;/&#8217;</span>, opt<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
<p>I started to look on http:\\www.google.com for a similar problem. I found the problem with IE 6, but there was no real fix to the problem. The problem was Element.update() of prototype. There was a fix (i think on rails mailing list) which hacks protoype.js. It works but it replaces the whole select box instead of changing only the options. So if you change also the select tag you loose the onchange trigger so you cannot trigger the next select box.</p>
<p>So since i knew the name of function which should be called via on change. I changed the functions with Element.replace.</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4b9ce7383c256">
<div class="synthi_header" style="font-weight:bold;"> JAVASCRIPT <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4b9ce7383c256').style.display='block';document.getElementById('plain_synthi_4b9ce7383c256').style.display='none';return false">Show Styled Code</a>]:</span></div>
<pre style="width:100%;overflow:auto;">
function loadSomeMore() {
	if($F('some') != ''none) {
		var opt = {
			onSuccess: function(t) {
				$('someMore').replace('
<select name=&#034;address[someMore]&#034; id=&#034;SomeMore&#034; onchange=&#034;someEvenMore();&#034;>' + t.responseText + '</select>

');
			}
		}
		new Ajax.Request('/ajax/address/somevenMore/' + $F('some') + '/', opt);
	}
}
</pre>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4b9ce7383c256">
<div class="synthi_header" style="font-weight:bold;"> JAVASCRIPT <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4b9ce7383c256').style.display='block';document.getElementById('styled_synthi_4b9ce7383c256').style.display='none';return false">Show Plain Code</a>]:</span></div>
<div class="javascript" style="font-family: monospace;">
<ol>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> loadSomeMore<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>$F<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8217;some&#8217;</span><span style="color: #66cc66;">&#41;</span> != <span style="color: #3366CC;">&#8221;</span>none<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> opt = <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onSuccess: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>t<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8217;someMore&#8217;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;&lt;select name=&quot;address[someMore]&quot; id=&quot;SomeMore&quot; onchange=&quot;someEvenMore();&quot;&gt;&#8217;</span> + t.<span style="color: #006600;">responseText</span> + <span style="color: #3366CC;">&#8216;&lt;/select&gt;&#8217;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">new</span> Ajax.<span style="color: #006600;">Request</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;/ajax/address/somevenMore/&#8217;</span> + $F<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8217;some&#8217;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #3366CC;">&#8216;/&#8217;</span>, opt<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
<p>So if you want to make chained selects with prototype, instead of updating the select box options just replace the whole select box with its options. So the response from ajax would be:</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4b9ce73851e2a">
<div class="synthi_header" style="font-weight:bold;"> HTML <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4b9ce73851e2a').style.display='block';document.getElementById('plain_synthi_4b9ce73851e2a').style.display='none';return false">Show Styled Code</a>]:</span></div>
<pre style="width:100%;overflow:auto;">
<select onchange=&#034;loadNextSelectBox();&#034;>
     <option>
     <option>
</select>
</pre>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4b9ce73851e2a">
<div class="synthi_header" style="font-weight:bold;"> HTML <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4b9ce73851e2a').style.display='block';document.getElementById('styled_synthi_4b9ce73851e2a').style.display='none';return false">Show Plain Code</a>]:</span></div>
<div class="html4strict" style="font-family: monospace;">
<ol>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/select.html"><span style="color: #000000; font-weight: bold;">&lt;select</span></a> <span style="color: #000066;">onchange</span>=<span style="color: #ff0000;">&quot;loadNextSelectBox();&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #009900;"><a href="http://december.com/html/4/element/option.html"><span style="color: #000000; font-weight: bold;">&lt;option&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #009900;"><a href="http://december.com/html/4/element/option.html"><span style="color: #000000; font-weight: bold;">&lt;option&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/select&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
<p>instead of </p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4b9ce73872139">
<div class="synthi_header" style="font-weight:bold;"> HTML <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4b9ce73872139').style.display='block';document.getElementById('plain_synthi_4b9ce73872139').style.display='none';return false">Show Styled Code</a>]:</span></div>
<pre style="width:100%;overflow:auto;">
<option>
<option>
</pre>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4b9ce73872139">
<div class="synthi_header" style="font-weight:bold;"> HTML <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4b9ce73872139').style.display='block';document.getElementById('styled_synthi_4b9ce73872139').style.display='none';return false">Show Plain Code</a>]:</span></div>
<div class="html4strict" style="font-family: monospace;">
<ol>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/option.html"><span style="color: #000000; font-weight: bold;">&lt;option&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/option.html"><span style="color: #000000; font-weight: bold;">&lt;option&gt;</span></a></span> </div>
</li>
</ol>
</div>
</div>
<p>I am not sure if the example above would work, the id&#8217;s are mixed. But otherwise the script works fine. The next functions for next child in chained select is almost copy paste, so it is fast to make.</p>
<p>Have fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://maraz.org/2007/05/23/prototype-scriptaculous-chained-select/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Getting lazy with frameworks (ZEND)</title>
		<link>http://maraz.org/2007/05/16/getting-lazy-with-frameworks-zend/</link>
		<comments>http://maraz.org/2007/05/16/getting-lazy-with-frameworks-zend/#comments</comments>
		<pubDate>Wed, 16 May 2007 20:58:56 +0000</pubDate>
		<dc:creator>silvester</dc:creator>
		
		<category><![CDATA[All]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://maraz.org/2007/05/16/getting-lazy-with-frameworks-zend/</guid>
		<description><![CDATA[For my new huge project, i did some research so I would work less. I started with cake php and after one week learning i decided that it is no good for me. My last project is not a web site and cakephp looks like it is done for making blogs and news pages.
Then i [...]]]></description>
			<content:encoded><![CDATA[<p>For my new huge project, i did some research so I would work less. I started with cake php and after one week learning i decided that it is no good for me. My last project is not a web site and cakephp looks like it is done for making blogs and news pages.</p>
<p>Then i started to look at ZEND FRAMEWORK. It is a lot more flexible then cakephp and i also didnt needed scafolding. So after learning about a week I started to work on the project. In the begining it went very well, but after 2 month the pain started. I just got to lazy and depended on the framework.</p>
<p>On my earlier projects I allways wrote a small framework which would help me to work through the project. If i had to write something more than twice, I decided to write a function or even better an object.</p>
<p>When i work with zend framework, i just skipped the first process and started to write hardcoded in to the actions. Now as things get more complicated I have a great lack of my usual objects and classes.</p>
<p>So i learned, never get layz of writing the helpers of a project. Take around 30% in the begining of a project for writing your own objects. This will also help you to solve problems even before they occur.</p>
]]></content:encoded>
			<wfw:commentRss>http://maraz.org/2007/05/16/getting-lazy-with-frameworks-zend/feed/</wfw:commentRss>
		</item>
		<item>
		<title>script.aculo.us Effect.toggle.(&#8217;MyAss&#8217;)</title>
		<link>http://maraz.org/2007/01/06/scriptaculous-effecttogglemyass/</link>
		<comments>http://maraz.org/2007/01/06/scriptaculous-effecttogglemyass/#comments</comments>
		<pubDate>Sat, 06 Jan 2007 02:01:36 +0000</pubDate>
		<dc:creator>silvester</dc:creator>
		
		<category><![CDATA[All]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[Prototype]]></category>

		<category><![CDATA[Scriptaculous]]></category>

		<guid isPermaLink="false">http://maraz.org/2007/01/06/scriptaculous-effecttogglemyass/</guid>
		<description><![CDATA[For one of my clients, i had to clean up some mess which was done by another college. The web site has a registration form and a login form which is both in the same screen. This makes the screen look too big and too complicated. There were also some fields and forms which are [...]]]></description>
			<content:encoded><![CDATA[<p>For one of my clients, i had to clean up some mess which was done by another college. The web site has a registration form and a login form which is both in the same screen. This makes the screen look too big and too complicated. There were also some fields and forms which are at wish if you only choose specific options.</p>
<p>So i decided to make the form look smaller. I wanted to hide some fields until they are not checked or used. I stared to program at 21:40.</p>
<h3>1. Scenario 21:50 (after some cigarets and jagermeister)</h3>
<p>I have some background experience with <a href="http://mootools.net" target="_blank">http://mootools.net</a> and <a href="http://script.aculo.us/">http://script.aculo.us</a>. Because I allready use scriptticolumous in the web site i decided to use scriptaulimoumus but I still don&#8217;t know how to spell it or read (always have to search on google.com that he corrects my misspelling).</p>
<p><span id="more-13"></span></p>
<p>After like an half an hour reading i tried to use the toggle function. And some code which i would write would look like:</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4b9ce73c4e9b1">
<div class="synthi_header" style="font-weight:bold;"> HTML <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4b9ce73c4e9b1').style.display='block';document.getElementById('plain_synthi_4b9ce73c4e9b1').style.display='none';return false">Show Styled Code</a>]:</span></div>
<pre style="width:100%;overflow:auto;">
<form>
<table width=&#034;100%&#034; border=&#034;0&#034; cellspacing=&#034;0&#034; cellpadding=&#034;0&#034;>
<tr>
<td>
<input type=&#034;checkbox&#034; name=&#034;checkMeToSeHiddenFields&#034; id=&#034;checkMeToSeHiddenFields&#034; onclick=&#034;Effect.toggle('content_to_show', 'slide')&#034;> Click me to see something</td>
</tr>
<tr>
<td>
<div id=&#034;content_to_show&#034; style=&#034;display:none&#034;>
<div>
<input type=&#034;text&#034; name=&#034;noname&#034; /></div>
</div>
</td>
</tr>
<tr>
<td>
<input type=&#034;submit&#034; value=&#034;submit&#034; /></td>
</tr>
</table>
</form>
</pre>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4b9ce73c4e9b1">
<div class="synthi_header" style="font-weight:bold;"> HTML <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4b9ce73c4e9b1').style.display='block';document.getElementById('styled_synthi_4b9ce73c4e9b1').style.display='none';return false">Show Plain Code</a>]:</span></div>
<div class="html4strict" style="font-family: monospace;">
<ol>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">&lt;form&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/table.html"><span style="color: #000000; font-weight: bold;">&lt;table</span></a> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">border</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">cellspacing</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">cellpadding</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">&lt;tr&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">&lt;td&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;checkMeToSeHiddenFields&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;checkMeToSeHiddenFields&quot;</span> <span style="color: #000066;">onclick</span>=<span style="color: #ff0000;">&quot;Effect.toggle(&#8217;content_to_show&#8217;, &#8217;slide&#8217;)&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> Click me to see something<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">&lt;tr&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">&lt;td&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;content_to_show&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;display:none&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;noname&quot;</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">&lt;tr&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">&lt;td&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;submit&quot;</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/table&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/form&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
<p>I think this is pretty straight forward. What it does, on the beginning the checkbox is not checked and the div is not shown so if you would click on the checkbox it would be checked and the layer would be shown. Basiclly it works, if you are smart and with no adrenalin and no stress. But for me no way, as soon as i see something to click i would click on it like 5 billion times a second to make it crash or to relax. So after clicking a few million times i saw that the checkbox was checked but the div was not shown and some more million clicks the checkbox was not checked and the div was shown. :-( no shit. </p>
<h3>2. Scenario 22:30(some more cigarets and &#8230;)</h3>
<p>What now? I decided to handle the toggle function on my own. Now the new code:</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4b9ce73cf3eaa">
<div class="synthi_header" style="font-weight:bold;"> JAVASCRIPT <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4b9ce73cf3eaa').style.display='block';document.getElementById('plain_synthi_4b9ce73cf3eaa').style.display='none';return false">Show Styled Code</a>]:</span></div>
<pre style="width:100%;overflow:auto;">
<script type=&#034;text/javascript&#034;>
function toggleSomeEffect() {
	if($('checkMeToSeHiddenFields').checked == true) { // the checkbox to check
		if($('content_to_show').visible()) { // if the div is visible do nothing

		} else { // else show the div.
			Effect.SlideDown('content_to_show');
		}
	} else { // not checked so dont show it
		if($('content_to_show').visible()) { // if div visible hide it
			Effect.SlideUp('content_to_show');
		}
	}
}
</script>
</pre>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4b9ce73cf3eaa">
<div class="synthi_header" style="font-weight:bold;"> JAVASCRIPT <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4b9ce73cf3eaa').style.display='block';document.getElementById('styled_synthi_4b9ce73cf3eaa').style.display='none';return false">Show Plain Code</a>]:</span></div>
<div class="javascript" style="font-family: monospace;">
<ol>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;script type=<span style="color: #3366CC;">&quot;text/javascript&quot;</span>&gt;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> toggleSomeEffect<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;checkMeToSeHiddenFields&#8217;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">checked</span> == <span style="color: #003366; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #009900; font-style: italic;">// the checkbox to check</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;content_to_show&#8217;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">visible</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #009900; font-style: italic;">// if the div is visible do nothing</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #009900; font-style: italic;">// else show the div.</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Effect.<span style="color: #006600;">SlideDown</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;content_to_show&#8217;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #009900; font-style: italic;">// not checked so dont show it</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;content_to_show&#8217;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">visible</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #009900; font-style: italic;">// if div visible hide it</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Effect.<span style="color: #006600;">SlideUp</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;content_to_show&#8217;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/script&gt; </div>
</li>
</ol>
</div>
</div>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4b9ce73d13104">
<div class="synthi_header" style="font-weight:bold;"> HTML <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4b9ce73d13104').style.display='block';document.getElementById('plain_synthi_4b9ce73d13104').style.display='none';return false">Show Styled Code</a>]:</span></div>
<pre style="width:100%;overflow:auto;">
<form>
<table width=&#034;100%&#034; border=&#034;0&#034; cellspacing=&#034;0&#034; cellpadding=&#034;0&#034;>
<tr>
<td>
<input type=&#034;checkbox&#034; name=&#034;checkMeToSeHiddenFields&#034; id=&#034;checkMeToSeHiddenFields&#034; onclick=&#034;toggleSomeEffect()&#034;> Click me to see something</td>
</tr>
<tr>
<td>
<div id=&#034;content_to_show&#034; style=&#034;display:none&#034;>
<div>
<input type=&#034;text&#034; name=&#034;noname&#034; /></div>
</div>
</td>
</tr>
<tr>
<td>
<input type=&#034;submit&#034; value=&#034;submit&#034; /></td>
</tr>
</table>
</form>
</pre>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4b9ce73d13104">
<div class="synthi_header" style="font-weight:bold;"> HTML <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4b9ce73d13104').style.display='block';document.getElementById('styled_synthi_4b9ce73d13104').style.display='none';return false">Show Plain Code</a>]:</span></div>
<div class="html4strict" style="font-family: monospace;">
<ol>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">&lt;form&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/table.html"><span style="color: #000000; font-weight: bold;">&lt;table</span></a> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">border</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">cellspacing</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">cellpadding</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">&lt;tr&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">&lt;td&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;checkMeToSeHiddenFields&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;checkMeToSeHiddenFields&quot;</span> <span style="color: #000066;">onclick</span>=<span style="color: #ff0000;">&quot;toggleSomeEffect()&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> Click me to see something<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">&lt;tr&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">&lt;td&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;content_to_show&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;display:none&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;noname&quot;</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">&lt;tr&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">&lt;td&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;submit&quot;</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/table&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/form&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
<p>I thought this might work and started to click on it 5 billion times a second same thing they are not syncronized as they should be. :-( kiss my ass.</p>
<h3>3. Scenario 11:50 (more smoke)</h3>
<p>There are some more smaller in scenarios in the story but will just skip them not make it so exciting huh. So i decided to make a fuse which would tell me if everything is allready done. So this is the last one.</p>
<p>I started to read the callback functions and found beforeStart and afterFinish. So would before start make a variable true and after finish make the variable false. In that way i would know when i could make another Effect call. in the afterFinish callback function i would also implement a checking for the checkbox which would tell me if it is checked or not and show the div or not. In this way they will be always syncronized.</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4b9ce73dbfaca">
<div class="synthi_header" style="font-weight:bold;"> JAVASCRIPT <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4b9ce73dbfaca').style.display='block';document.getElementById('plain_synthi_4b9ce73dbfaca').style.display='none';return false">Show Styled Code</a>]:</span></div>
<pre style="width:100%;overflow:auto;">
<script type=&#034;text/javascript&#034;>
var finito = true; // our fuse variable

function beforeStartCallMe(obj) { // this gives you the div object obj.
	finito = false; // we started an Effect.
}

function afterFinishCallMe(obj) {
	finito = true; // the effect is finished.
	if($('checkMeToSeHiddenFields').checked == true) { // if checked.
		if($('content_to_show').visible() == false) { // and div not visible
			Effect.SlideDown('content_to_show', {beforeStart: beforeStartCallMe, afterFinish: afterFinishCallMe});
		}
	} else {
		if($('content_to_show').visible()) { // if visible div but not checked checkbox
			Effect.SlideUp('content_to_show', {beforeStart:beforeStartCallMe, afterFinish: afterFinishCallMe});
		}
	}
}

function toggleSomeEffect() {
	if($('checkMeToSeHiddenFields').checked == true) {		
		if($('content_to_show').visible()) {
		} else {
			if(finito) {
				Effect.SlideDown('content_to_show', {beforeStart: beforeStartCallMe, afterFinish: afterFinishCallMe});
			}
		}
	} else {
		if($('content_to_show').visible() &#038;&#038; finito) {
			Effect.SlideUp('content_to_show', {beforeStart: beforeStartCallMe, afterFinish: afterFinishCallMe});
		}
	}
}
</script>
</pre>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4b9ce73dbfaca">
<div class="synthi_header" style="font-weight:bold;"> JAVASCRIPT <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4b9ce73dbfaca').style.display='block';document.getElementById('styled_synthi_4b9ce73dbfaca').style.display='none';return false">Show Plain Code</a>]:</span></div>
<div class="javascript" style="font-family: monospace;">
<ol>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;script type=<span style="color: #3366CC;">&quot;text/javascript&quot;</span>&gt;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> finito = <span style="color: #003366; font-weight: bold;">true</span>; <span style="color: #009900; font-style: italic;">// our fuse variable</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> beforeStartCallMe<span style="color: #66cc66;">&#40;</span>obj<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #009900; font-style: italic;">// this gives you the div object obj.</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; finito = <span style="color: #003366; font-weight: bold;">false</span>; <span style="color: #009900; font-style: italic;">// we started an Effect.</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> afterFinishCallMe<span style="color: #66cc66;">&#40;</span>obj<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; finito = <span style="color: #003366; font-weight: bold;">true</span>; <span style="color: #009900; font-style: italic;">// the effect is finished.</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;checkMeToSeHiddenFields&#8217;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">checked</span> == <span style="color: #003366; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #009900; font-style: italic;">// if checked.</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;content_to_show&#8217;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">visible</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #003366; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #009900; font-style: italic;">// and div not visible</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Effect.<span style="color: #006600;">SlideDown</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;content_to_show&#8217;</span>, <span style="color: #66cc66;">&#123;</span>beforeStart: beforeStartCallMe, afterFinish: afterFinishCallMe<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;content_to_show&#8217;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">visible</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #009900; font-style: italic;">// if visible div but not checked checkbox</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Effect.<span style="color: #006600;">SlideUp</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;content_to_show&#8217;</span>, <span style="color: #66cc66;">&#123;</span>beforeStart:beforeStartCallMe, afterFinish: afterFinishCallMe<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> toggleSomeEffect<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;checkMeToSeHiddenFields&#8217;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">checked</span> == <span style="color: #003366; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;content_to_show&#8217;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">visible</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>finito<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Effect.<span style="color: #006600;">SlideDown</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;content_to_show&#8217;</span>, <span style="color: #66cc66;">&#123;</span>beforeStart: beforeStartCallMe, afterFinish: afterFinishCallMe<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;content_to_show&#8217;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">visible</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> &amp;&amp; finito<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Effect.<span style="color: #006600;">SlideUp</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&#8216;content_to_show&#8217;</span>, <span style="color: #66cc66;">&#123;</span>beforeStart: beforeStartCallMe, afterFinish: afterFinishCallMe<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/script&gt; </div>
</li>
</ol>
</div>
</div>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4b9ce73e032f7">
<div class="synthi_header" style="font-weight:bold;"> HTML <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4b9ce73e032f7').style.display='block';document.getElementById('plain_synthi_4b9ce73e032f7').style.display='none';return false">Show Styled Code</a>]:</span></div>
<pre style="width:100%;overflow:auto;">
<form>
<table width=&#034;100%&#034; border=&#034;0&#034; cellspacing=&#034;0&#034; cellpadding=&#034;0&#034;>
<tr>
<td>
<input type=&#034;checkbox&#034; name=&#034;checkMeToSeHiddenFields&#034; id=&#034;checkMeToSeHiddenFields&#034; onclick=&#034;toggleSomeEffect()&#034;> Click me to see something</td>
</tr>
<tr>
<td>
<div id=&#034;content_to_show&#034; style=&#034;display:none&#034;>
<div>
<input type=&#034;text&#034; name=&#034;noname&#034; /></div>
</div>
</td>
</tr>
<tr>
<td>
<input type=&#034;submit&#034; value=&#034;submit&#034; /></td>
</tr>
</table>
</form>
</pre>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4b9ce73e032f7">
<div class="synthi_header" style="font-weight:bold;"> HTML <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4b9ce73e032f7').style.display='block';document.getElementById('styled_synthi_4b9ce73e032f7').style.display='none';return false">Show Plain Code</a>]:</span></div>
<div class="html4strict" style="font-family: monospace;">
<ol>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">&lt;form&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/table.html"><span style="color: #000000; font-weight: bold;">&lt;table</span></a> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">border</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">cellspacing</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">cellpadding</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">&lt;tr&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">&lt;td&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;checkMeToSeHiddenFields&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;checkMeToSeHiddenFields&quot;</span> <span style="color: #000066;">onclick</span>=<span style="color: #ff0000;">&quot;toggleSomeEffect()&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> Click me to see something<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">&lt;tr&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">&lt;td&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;content_to_show&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;display:none&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;noname&quot;</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">&lt;tr&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">&lt;td&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;submit&quot;</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/table&gt;</span></span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/form&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
<p>Now this it. The time is 3:00 i am half drunk but the thing work. I does not mess up the screen and they stay syncronized.</p>
<p>Some about me, i am not a javascript programmer and as a programmer I suck. There are for sure some shorter ways to to this, feel free to send them to me i will publish them and learn from them. I go sleep. :-) damn I am good.</p>
]]></content:encoded>
			<wfw:commentRss>http://maraz.org/2007/01/06/scriptaculous-effecttogglemyass/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Unlock Falk Navigator 3500 Pro SC (Tyhpoon MyGuide 3500 GO)</title>
		<link>http://maraz.org/2006/12/12/unlock-falk-navigator-3500-pro-sc-tyhpoon-myguide-3500-go/</link>
		<comments>http://maraz.org/2006/12/12/unlock-falk-navigator-3500-pro-sc-tyhpoon-myguide-3500-go/#comments</comments>
		<pubDate>Tue, 12 Dec 2006 15:36:09 +0000</pubDate>
		<dc:creator>silvester</dc:creator>
		
		<category><![CDATA[All]]></category>

		<category><![CDATA[GPS]]></category>

		<guid isPermaLink="false">http://maraz.org/2006/12/12/unlock-falk-navigator-3500-pro-sc-tyhpoon-myguide-3500-go/</guid>
		<description><![CDATA[Last year, short before christmas 2005, i went by car to Germany to visit my parents and relatives. I never went before to Germany  by car so it took like 7 hours to go there instead of 4 hours, the problem was that i was lost several times finding the right way to home. [...]]]></description>
			<content:encoded><![CDATA[<p>Last year, short before christmas 2005, i went by car to Germany to visit my parents and relatives. I never went before to Germany  by car so it took like 7 hours to go there instead of 4 hours, the problem was that i was lost several times finding the right way to home. So my father decided to by me gps navigation device for which i am very thankfull to him because i still loose my way where ever I go without the navigator.</p>
<p>We bought the navigator in <a title="Media Markt (Ich bin doch nicht blod)" target="_blank" href="http://www.mediaonline.de">mediamarkt</a> for 350 euros which was quite expensive, the price went down to 199 euros a month later. As written above name of the device is Falk Navigator 3500 Pro SC with some europe maps.</p>
<p>Of course i had to hack it, it took like a month that i was finished with it but it is now as usable as a handheld pc.</p>
<p>So these are the first steps to unlock it.</p>
<p><span id="more-5"></span></p>
<h3>1. Install activesync to your pc and upload the file <a id="p11" href="http://maraz.org/wp-content/uploads/2006/12/regedit.exe">Regedit ppc</a>.</h3>
<p>The place to put the file regedit is in /Windows/AutoStart.</p>
<p><img align="left" title="add_regedit.png" id="image6" alt="add_regedit.png" src="http://maraz.org/wp-content/uploads/2006/12/add_regedit.thumbnail.png" />After putting it in autostart restart your device, and you will se a window appearing before the general application start. If the first time you dont succseed to catch the regedit window just try again until you have it.</p>
<p><img align="left" title="open_regedit.png" id="image9" alt="open_regedit.png" src="http://maraz.org/wp-content/uploads/2006/12/open_regedit.thumbnail.png" /> When the application starts it looks like this. Then on the left side choose the registry LMachine and then init. On the bottom there will be a scroller, scroll down to Launch80: and delete it. In this picture it is not visible because i already deleted it the application name is i think miostartup.exe. After removing the key the device wont start anymore the application interface which keeps you away from the windows CE. Dont restart yet wait until you finish step 2.</p>
<h3>2. Upload now the file <a style="font-weight: bold" id="p12" href="http://maraz.org/wp-content/uploads/2006/12/showtaskbar.exe">Show taskbar</a> and remove the file regedit from the autostart.</h3>
<p><img align="left" title="add_taskbar.png" id="image7" alt="add_taskbar.png" src="http://maraz.org/wp-content/uploads/2006/12/add_taskbar.thumbnail.png" />If you leave the file regedit in autostart it will always run when you restart your device so just remove it you dont need this any more. After uploading showtaskbar and deleting regedit restart your device.</p>
<p><img align="left" title="show_taskbar.png" id="image10" alt="show_taskbar.png" src="http://maraz.org/wp-content/uploads/2006/12/show_taskbar.thumbnail.png" /> After restart you will get a taskbar and can start to use the windows ce.</p>
<h3 style="clear:both;">3. Not needed but good to do.</h3>
<p><img align="left" title="edit_memory.png" id="image8" alt="edit_memory.png" src="http://maraz.org/wp-content/uploads/2006/12/edit_memory.thumbnail.png" />It is good to change the memory settings of your device. The device has total 64 mb ram. A part of it is used as system memory and another part is used as storage place for applications. Just leave around 30 mb for system memory and it would be enough for the applications to run. You will gain around 20 mb place to store now new software in your device. To activate the setting use the button on your device. The button is the round one on the left side and you have to press it straight with out any direction.</p>
<p>Now you have an unlocked useless device. To make it more usefull go to the forums at <a title="All in one" target="_blank" href="http://www.gpspassion.com/forumsen/forum.asp?FORUM_ID=71">GPSPASSION</a> . In the forums there you will find somewhere a post with applications which can run under your device. You have to upload some dll files in your windows director. The files can be found in the forum.</p>
<p>I was able to run oziexplorer, tcpmc (video and audio player), tomtom 6 (version 5 never worked), route 66, a wierd version of navigon which was custom made for medion gps devices, the total commander from ghisler.com and the nydiot screen something helper which is very cool it allows you to change the screen resolution and some other things of your device.</p>
<p>In the forums you will also see that you can change the rom of your device. They will tell you that the mio something rom is the best but i will advice not to do that. If you still wish, find the software called osloader and make first a backup of your rom, then install the rom. There are like 20 rom versions and only one works for falk navigator. And after you find the working rom you will see that the mio rom sucks even more, even to hack it is a lot more work because the dont have the installed the activesync interface.</p>
<p>This is it for now. You can spend unlimited hours to pimp your navigator but still it will be a navigator, and 98% of the applications that you would find cool will not work on your device. Have fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://maraz.org/2006/12/12/unlock-falk-navigator-3500-pro-sc-tyhpoon-myguide-3500-go/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What to write ?</title>
		<link>http://maraz.org/2006/12/11/what-to-write/</link>
		<comments>http://maraz.org/2006/12/11/what-to-write/#comments</comments>
		<pubDate>Mon, 11 Dec 2006 00:44:26 +0000</pubDate>
		<dc:creator>silvester</dc:creator>
		
		<category><![CDATA[All]]></category>

		<guid isPermaLink="false">http://maraz.org/?p=4</guid>
		<description><![CDATA[After my instinct grove up to write a make a blog as before written i started my blog. I was pretty sure that i would be able to write something. Now i am sitting in front of my computer and dont know what to write.
I speak 4 languages (Sloven like in Slovenia, English, Turkish and [...]]]></description>
			<content:encoded><![CDATA[<p>After my instinct grove up to write a make a blog as before written i started my blog. I was pretty sure that i would be able to write something. Now i am sitting in front of my computer and dont know what to write.</p>
<p>I speak 4 languages (Sloven like in Slovenia, English, Turkish and German) so I had to decide in which language i am going to write. Since i live in <a title="Slovenija" target="_blank" href="http://www.slovenija.si">Slovenija</a> sloven could be a good choice but i just live here for 4 years and have no idea how to write correctly  in sloven. Once i had to write a letter for getting an internet connection at home, the lady there said i have to write an &#8220;Izjava&#8221; &#8220;Letter&#8221; that i really want internet at home,  i thought ok  maybe she didnt liked my voice so i write it down. For sure i didnt knew how the sloven people write this so i asked &#8220;Kaj moram napisati ?&#8221; &#8220;What do i have to write ?&#8221; then she said &#8220;Izjava&#8221; that i want internet at home, so i wrote with my really ugly handwriting an &#8220;Izjava&#8221;. I just wrote one line with a few words, something like &#8220;bla bla bla i want internet at home&#8221; and gave it to her. She almost had an heart attack, she was shocked. She started to tell me about how bad the schools in Slovenija became and people wouldnt be able even to write. Then i explained her as i always do, that bla bla i lived earlier in bla bla and didnt knew bla bla so i do not speak or write sloven very well, then she wrote the &#8220;Izjava&#8221; instead of me. :-) . So i said sloven is no good for me.</p>
<p>I could write in german, i studied a few years german language and literature in &#8220;9 Eylul&#8221; faculty. The quality of the writings would be same as sloven but without grammatical errors. But i dont like german language so i am not going to write in german.</p>
<p>Turkish is the language which i use for about 25 years so i and will write also in turkish.</p>
<p>English is a beautiful language, even if you speak or write wrong it sounds and looks correct :-).</p>
<p>Now i know which languages i am going to use English and Turkish. Still the problem is and I think it is quite visible i dont know how to write rather than i dont know what to write. Some people which are aware of my problem told that i would gain the skills through writing. I hope so, other vise no one will understand what i am trying to tell. :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://maraz.org/2006/12/11/what-to-write/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hello world! (My ass)</title>
		<link>http://maraz.org/2006/12/10/hello-world/</link>
		<comments>http://maraz.org/2006/12/10/hello-world/#comments</comments>
		<pubDate>Tue, 30 Nov 1999 00:00:00 +0000</pubDate>
		<dc:creator>silvester</dc:creator>
		
		<category><![CDATA[All]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!
This is what wordpress says when you install wordpress. I installed wordpress through the fantastico interface so had no work with the configuration and installation. It took like 2 minutes to install and run it.
Now the horror begins!!
After doing  2 [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</p>
<p>This is what wordpress says when you install wordpress. I installed wordpress through the fantastico interface so had no work with the configuration and installation. It took like 2 minutes to install and run it.</p>
<p>Now the horror begins!!</p>
<p>After doing  2 projects with wordpress i thought that why shouldnt i do also my <a title="Me" href="http://www.maraz.org">personal website</a> with wordpress. I allready started to do my own web site cms at least 20 times in 5-6 years without success. I thought wordpress is a real nice tool to work with and modify. (i still do if i work.)<br />
Now some background information about me.<br />
- I hate css<br />
- I have no idea how to work with it<br />
- I am programming php for 6-7 years now<br />
- Have done at least 20 websites by using tables which look the same on every browser!</p>
<p>So as an incompatible person with css i started to modify wordpress. I downloaded the K2 theme from <a target="_blank" title="K2" href="http://getk2.com/">http://getk2.com/</a> and started to look at the css in hopes that i would understand something. I read that K2 theme was a derivate of the famous theme <a title="kubrik" target="_blank" href="http://binarybonsai.com/wordpress/kubrick/">kubrick</a> and there it was written that the new theme K2 would be more advanced and well-coded, and as someone who believes to be able to hack all well-coded software i said &#8220;<span style="font-style: italic">This must be the right theme for me</span>&#8220;.</p>
<p>Half an hour later it was all gone i started to think that people who cant code would hack, write plugins and make themes for wordpress, so it couldnt be a good and well-coded theme. The theme took evertime to reload the page about 20 seconds with no error message but ok the 20 second would mean also an error for me. So i uninstalled it.</p>
<p>I went to http://themes.wordpress.org and downloaded the theme blix as you can see. Again i started to look at the css and again i just said &#8220;<em>no shit</em>&#8221;  the same story. I wouldnt be able to modify it without losing my nerves, so it will be as it is. It looks pretty.</p>
<p>This is what happens when someone has no idea what he is doing. He will allways just complain. For sure wordpress is good coded and many of the themes are well done.</p>
<p>Whatever I still dont like the idea.</p>
]]></content:encoded>
			<wfw:commentRss>http://maraz.org/2006/12/10/hello-world/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
