<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: gridcomplete function with parameters called before grid is complete</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/gridcomplete-function-with-parameters-called-before-grid-is-complete</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/bugs/gridcomplete-function-with-parameters-called-before-grid-is-complete/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>jakemonO on gridcomplete function with parameters called before grid is complete</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/gridcomplete-function-with-parameters-called-before-grid-is-complete#p20412</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/gridcomplete-function-with-parameters-called-before-grid-is-complete#p20412</guid>
        	        	<description><![CDATA[<p>I too have a <em>similar</em> problem: If I pass a function to gridComplete (to attach styles and events to the loaded table) it works fine. If I attach an object method <em>with the same code as the working function</em> the jquery collections in the method that I use to attach styles to are empty. It appears that this type of event is fired before the jqGrid is fully loaded.</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4203' value='Select Code' data-codeid='sfcode4203' /></p>
<div class='sfcode' id='sfcode4203'>loadComplete: window.dataGrid.finalizeDataGrid(),</div>
</p>
<p>As far as I can tell, it&#39;s b/c passing a function or method of any type is a fundamentally different Javascript operation that copying a function i.e. the difference between</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2233' value='Select Code' data-codeid='sfcode2233' /></p>
<div class='sfcode' id='sfcode2233'>loadComplete: window.dataGrid.finalizeDataGrid()</div>
</p>
<p>and</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4523' value='Select Code' data-codeid='sfcode4523' /></p>
<div class='sfcode' id='sfcode4523'>loadComplete: window.dataGrid.finalizeDataGrid</div>
<p>Not sure of a workaround other than changing the way my backing object is set up. Some background on this (not so) subtle difference <a href="http://www.quirksmode.org/js/this.html" target="_blank">here</a>. If anyone with greater JavaScript-fu can shed some light and help me accomplish what I need without breaking my model, I&#39;d appreciate&#8230;</p>
</p>
<p>UPDATE: The answer came to me right after I posted this, and I suspect something similar would help @markbennet as well:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2623' value='Select Code' data-codeid='sfcode2623' /></p>
<div class='sfcode' id='sfcode2623'>&#160;&#160;&#160;&#160;&#160; loadComplete: function() {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; window.dataGrid.finalizeDataGrid()<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; },</div></p>
]]></description>
        	        	<pubDate>Thu, 21 Oct 2010 20:03:40 +0300</pubDate>
        </item>
        <item>
        	<title>markbennett on gridcomplete function with parameters called before grid is complete</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/gridcomplete-function-with-parameters-called-before-grid-is-complete#p18747</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/gridcomplete-function-with-parameters-called-before-grid-is-complete#p18747</guid>
        	        	<description><![CDATA[<p>Thanks for the quick reply Tony, but I don&#39;t think the problem is in my code (although that&#39;s always a possibility <img class="spSmiley" style="margin:0" title="Wink" src="/blog/wp-content/forum-smileys/sf-wink.gif" alt="Wink" />).</p>
</p>
<p>If I build the table with <strong>gridComplete: bindHelpIcons</strong> in the jqGrid initialisation, everything works perfectly.</p>
<p>If I build the table with <strong>gridComplete: bindHelpIcons("table1")</strong> in the jqGrid initialisation, the bindHelpIcons function is called before the table has even been drawn. The parameter gets passed to the function OK, and there is nothing else on the page which calls the function.</p>
</p>
<p>I&#39;m quite happy to work around this by calling a parameterless function - I just wanted to let you know there may be an issue with your event firing.</p>
]]></description>
        	        	<pubDate>Thu, 22 Jul 2010 17:23:35 +0300</pubDate>
        </item>
        <item>
        	<title>tony on gridcomplete function with parameters called before grid is complete</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/gridcomplete-function-with-parameters-called-before-grid-is-complete#p18740</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/gridcomplete-function-with-parameters-called-before-grid-is-complete#p18740</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>To the gridComplete we do not pass any parameter and this event is called after everthing is into the dom.</p>
<p>Please check Your code.</p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Thu, 22 Jul 2010 15:17:36 +0300</pubDate>
        </item>
        <item>
        	<title>tony on gridcomplete function with parameters called before grid is complete</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/gridcomplete-function-with-parameters-called-before-grid-is-complete#p18737</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/gridcomplete-function-with-parameters-called-before-grid-is-complete#p18737</guid>
        	        	<description><![CDATA[]]></description>
        	        	<pubDate>Thu, 22 Jul 2010 14:53:21 +0300</pubDate>
        </item>
        <item>
        	<title>markbennett on gridcomplete function with parameters called before grid is complete</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/gridcomplete-function-with-parameters-called-before-grid-is-complete#p18735</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/gridcomplete-function-with-parameters-called-before-grid-is-complete#p18735</guid>
        	        	<description><![CDATA[<p>I&#39;ve got a table which has buttons in some of the cells, and I want to bind javascript functions to the buttons.</p>
</p>
<p>If I create a parameterless javascript function, and set the table gridcomplete to this function, then everything works fine - when the grid data has been loaded into the DOM, the gridcomplete event fires, my function is called, my buttons get their click handlers attached, and everything is good.</p>
</p>
<p>If I create a javascript function which takes a parameter (e.g. the table ID, when I have multiple tables on a page), and set the table gridcomplete to this function with a parameter (e.g. gridcomplete: bindIcons("table1")), the gridcomplete event fires <strong>before</strong> the data has been loaded into the grid, so the buttons don&#39;t exist yet, and the click handlers do not get attached. An alert dialog in my bindIcons function shows that the function does get called, and the parameter gets passed just fine - it just gets called too early!</p>
]]></description>
        	        	<pubDate>Thu, 22 Jul 2010 14:27:58 +0300</pubDate>
        </item>
</channel>
</rss>