<?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: small bug in grid.jqueryui.js and ui.multiselect.js</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-grid-jqueryui-js-and-ui-multiselect-js</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/small-bug-in-grid-jqueryui-js-and-ui-multiselect-js/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on small bug in grid.jqueryui.js and ui.multiselect.js</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-grid-jqueryui-js-and-ui-multiselect-js#p14859</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-grid-jqueryui-js-and-ui-multiselect-js#p14859</guid>
        	        	<description><![CDATA[<p>Hello Oleg,</p>
<p>Thank you very much for the recommendaions and investigations.</p>
<p>For now I do not have time to work on this.</p>
<p>Simply I recommend to make the changes in grid.jquery.ui.</p>
<p>Open the file and you will see at the beginning the following pice of code:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9540' value='Select Code' data-codeid='sfcode9540' /></p>
<div class='sfcode' id='sfcode9540'>
<p>if ($.ui &#38;&#38; $.ui.multiselect &#38;&#38; $.ui.multiselect.prototype._setSelected) {<br />&#160;&#160;&#160; var setSelected = $.ui.multiselect.prototype._setSelected;<br />&#160;&#160;&#160; $.ui.multiselect.prototype._setSelected = function(item,selected) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; var ret = setSelected.call(this,item,selected);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (selected &#38;&#38; this.selectedList) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var elt = this.element;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; this.selectedList.find(&#39;li&#39;).each(function() {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; if ($(this).data(&#39;optionLink&#39;))<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; $(this).data(&#39;optionLink&#39;).remove().appendTo(elt);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return ret;<br />&#160;&#160;&#160; }<br />}</p>
</div>
<p>this can be easy extended as</p>
<p>if ($.ui &#38;&#38; $.ui.multiselect &#38;&#38; ) {</p>
<p>if($.ui.multiselect.prototype._setSelected) {<br />&#160;&#160;&#160; var setSelected = $.ui.multiselect.prototype._setSelected;<br />&#160;&#160;&#160; $.ui.multiselect.prototype._setSelected = function(item,selected) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; var ret = setSelected.call(this,item,selected);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (selected &#38;&#38; this.selectedList) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var elt = this.element;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; this.selectedList.find(&#39;li&#39;).each(function() {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; if ($(this).data(&#39;optionLink&#39;))<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; $(this).data(&#39;optionLink&#39;).remove().appendTo(elt);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return ret;<br />&#160;&#160;&#160; }</p>
<p>}</p>
<p>if($.ui.multiselect.prototype.destroy) {</p>
<p>// your code here</p>
<p>}<br />}</p>
<p>I recommend if possible to change the things in grid code instead and do not change multiselect.</p>
<p>At end of week I will play with this.</p>
<p>Best Regards and thanks again</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Wed, 17 Feb 2010 11:15:14 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on small bug in grid.jqueryui.js and ui.multiselect.js</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-grid-jqueryui-js-and-ui-multiselect-js#p14839</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-grid-jqueryui-js-and-ui-multiselect-js#p14839</guid>
        	        	<description><![CDATA[<p>Hi Tony!</p>
<p>Only short additional information. Just downloaded jQuery UI 1.8rc2 with jQuery 1.4.2 (from <a title="http://blog.jqueryui.com/2010/02/jquery-ui-18rc2/" onclick="javascript:pageTracker._trackPageview(&#39;/outbound/article/http://blog.jqueryui.com/2010/02/jquery-ui-18rc2/&#39;);" href="http://blog.jqueryui.com/2010/02/jquery-ui-18rc2/" target="_blank"></a><a href="http://blog.jqueryui.com/2010/" rel="nofollow" target="_blank">http://blog.jqueryui.com/2010/</a>.....-ui-18rc2/) and tested everything here written one more time. Everything still works exactly as unter jQuery UI 1.8rc1 and jQuery 1.4.2.</p>
<p>Corresponds to just published <a href="http://docs.jquery.com/UI/Upgrade_Guide_18#Widget_Factory" target="_blank">the widget factory section of the Upgrade Guide</a> to fix problem with $.ui.multiselect.defaults it is recomended to start</p>
<p>$.widget("ui.multiselect", {<br />&#160;&#160;&#160; options: {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortable: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; searchable: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; animated: &#39;fast&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; show: &#39;slideDown&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; hide: &#39;slideUp&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; dividerLocation: 0.6,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; nodeComparator: function(node1, node2) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var text1 = node1.text(),<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; text2 = node2.text();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return text1 == text2 ? 0 : (text1 &#60; text2 ? -1 : 1);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160; },<br />&#160;&#160;&#160; _init: function() {</p>
<p>...</p>
<p>instead of calling</p>
<p><strong>mopts = $.extend({},  $.ui.multiselect.defaults, mopts &#124;&#124; {});</strong></p>
<p>before call of call(opts.msel, select,  mopts) inside of <strong>grid.jqueryui.js</strong>. Other changes from "Upgrade Guide" seems me not so important. For example, one recomends to rename _init to _create, but the code in jquery.ui.widget.js in jQuery UI 1.8rc2/rc2 looks like following:</p>
<p>_createWidget: function( options, element ) {</p>
<p>...</p>
<p>&#160;&#160; &#160;&#160;&#160;&#160; this._create();<br />&#160;&#160; &#160;&#160;&#160; &#160;this._init();<br />&#160;&#160; &#160;},<br />&#160;&#160; &#160;_create: function() {},<br />&#160;&#160; &#160;_init: function() {},</p>
<p>&#160;&#160; &#160;destroy: function() {<br />...</p>
<p>So both using of _create() or _init() will be working.</p>
<p>Different ways seems to me following to the same result. Currently we needs not make <strong>ui.multiselect.js</strong> perfect, but only make in working in both jQuery UI 1.8 and jQuery UI 1.7.</p>
</p>
<p>Best regards<br />Oleg</p>
]]></description>
        	        	<pubDate>Tue, 16 Feb 2010 19:33:38 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on small bug in grid.jqueryui.js and ui.multiselect.js</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-grid-jqueryui-js-and-ui-multiselect-js#p14829</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-grid-jqueryui-js-and-ui-multiselect-js#p14829</guid>
        	        	<description><![CDATA[<p><!--  /* Font Definitions */  @font-face 	{font-family:"MS Mincho"; 	panose-1:2 2 6 9 4 2 5 8 3 4;} @font-face 	{font-family:"MS Mincho"; 	panose-1:2 2 6 9 4 2 5 8 3 4;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4;} @font-face 	{font-family:"@MS Mincho"; 	panose-1:2 2 6 9 4 2 5 8 3 4;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{margin-top:0cm; 	margin-right:0cm; 	margin-bottom:10.0pt; 	margin-left:0cm; 	line-height:115%; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif";} .MsoChpDefault 	{font-family:"Calibri","sans-serif";} .MsoPapDefault 	{margin-bottom:10.0pt; 	line-height:115%;} @page WordSection1 	{size:595.3pt 841.9pt; 	margin:70.85pt 70.85pt 2.0cm 70.85pt;} div.WordSection1 	{page:WordSection1;} --></p>
<div class="WordSection1">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom:12.0pt; margin-left:0cm;line-height:normal"><span lang="EN-US">Hi Tony!</span></p>
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom:6.0pt; margin-left:0cm;line-height:normal"><span lang="EN-US">I&#8217;ll try to summarize me experience and suggestions to make <strong>columnChooser</strong> function from <strong>grid.jqueryui.js</strong> and <strong>ui.multiselect.js</strong> working with jquery-1.4.1 and jquery-ui-1.8rc1.</span></p>
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom:6.0pt; margin-left:0cm;line-height:normal"><span lang="EN-US">First of all, me previous suggestion to set mopts.dividerLocation to it&#8217;s default value was based on the exception inside of </span><span style="font-size:10.0pt;font-family:" lang="EN-US">_init</span><span lang="EN-US"> function of <strong>ui.multiselect.js</strong> in the lines 47-48:</span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;text-autospace:none"><span style="font-size:8.0pt;font-family:" lang="EN-US">&#160;&#160;&#160; this</span><span style="font-size:8.0pt; font-family:" lang="EN-US">.selectedContainer.width(Math.floor(<span style="color: blue;">this</span>.element.width()*<span style="color:blue">this</span>.options.dividerLocation));</span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;text-autospace:none"><span style="font-size:8.0pt;font-family:" lang="EN-US">&#160;&#160;&#160; this</span><span style="font-size:8.0pt; font-family:" lang="EN-US">.availableContainer.width(Math.floor(<span style="color: blue;">this</span>.element.width()*(1-<span style="color:blue">this</span>.options.dividerLocation)));</span></p>
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom:6.0pt; margin-left:0cm;line-height:normal"><span lang="EN-US">The real problem is, that <strong>ui.multiselect.js</strong> define but don&#8217;t use </span><span style="font-size:10.0pt; font-family:" lang="EN-US">$.ui.multiselect.defaults</span><span lang="EN-US">. So one receives "Invalid argument" Exception inside of jquery-1.4.1.js &#160;(line 4456) during attempt to set </span><span style="font-size: 10.0pt;font-family:" lang="EN-US">width</span><span lang="EN-US"> of element to NaNpx value.</span></p>
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom:6.0pt; margin-left:0cm;line-height:normal"><span lang="EN-US">One can fix the problem inside of <strong>grid.jqueryui.js</strong>. One can insert an additional line after the line number 238 in <strong>grid.jqueryui.js</strong>:</span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;text-autospace:none"><span style="font-size:8.0pt;font-family:" lang="EN-US">&#160;&#160;&#160; var</span><span style="font-size:8.0pt; font-family:" lang="EN-US"> mopts = $.isFunction(opts.msel_opts) ? opts.msel_opts.call(self, opts) : opts.msel_opts;</span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;text-autospace:none"><strong><span style="font-size:8.0pt; font-family:" lang="EN-US">&#160;&#160;&#160; mopts = $.extend({}, $.ui.multiselect.defaults, mopts &#124;&#124; {});</span></strong></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;text-autospace:none"><span style="font-size:8.0pt;font-family:" lang="EN-US">&#160;&#160;&#160; call(opts.msel, select, mopts);</span></p>
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom:6.0pt; margin-left:0cm;line-height:normal"><span lang="EN-US">To fix problem with destructor of <strong>ui.multiselect</strong> I suggest make following change inside of </span><span style="font-size: 10pt; font-family: &#34;Courier New&#34;;" lang="EN-US">destroy</span><span lang="EN-US"> function:</span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;text-autospace:none"><span style="font-size:8.0pt;font-family:">&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="font-size: 8pt; font-family: &#34;Courier New&#34;;" lang="EN-US">destroy: <span style="color: blue;">function</span>() {</span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;text-autospace:none"><span style="font-size:8.0pt;font-family:" lang="EN-US">&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; <span style="color:blue">this</span>.element.show();</span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;text-autospace:none"><span style="font-size:8.0pt;font-family:" lang="EN-US">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:blue">this</span>.container.remove();</span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;text-autospace:none"><span style="font-size:8.0pt;font-family:" lang="EN-US">&#160;</span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;text-autospace:none"><strong><span style="font-size:8.0pt; font-family:" lang="EN-US">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:blue">if</span> ($.Widget === undefined)</span></strong></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;text-autospace:none"><span style="font-size:8.0pt;font-family:" lang="EN-US">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; $.widget.prototype.destroy.apply(<span style="color: blue;">this</span>, arguments);</span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;text-autospace:none"><strong><span style="font-size:8.0pt; font-family:" lang="EN-US">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:blue">else</span> {</span></strong></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;text-autospace:none"><strong><span style="font-size:8.0pt; font-family:" lang="EN-US">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; $.Widget.prototype.destroy.apply(<span style="color: blue;">this</span>, arguments);</span></strong></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;text-autospace:none"><strong><span style="font-size:8.0pt; font-family:" lang="EN-US">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; <span style="color:blue">return</span> <span style="color:blue">this</span>;</span></strong></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;text-autospace:none"><strong><span style="font-size:8.0pt; font-family:" lang="EN-US">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></strong></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;text-autospace:none"><span style="font-size:8.0pt;font-family:" lang="EN-US">&#160;&#160;&#160;&#160;&#160;&#160; },</span></p>
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom:6.0pt; margin-left:0cm;line-height:normal"><span lang="EN-US">Old version looks like</span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;text-autospace:none"><span style="font-size:8.0pt;font-family:">&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="font-size: 8pt; font-family: &#34;Courier New&#34;;" lang="EN-US">destroy: <span style="color: blue;">function</span>() {</span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm; margin-left:35.4pt;margin-bottom:.0001pt;text-indent:35.4pt;line-height:normal; text-autospace:none"><span style="font-size:8.0pt;font-family:" lang="EN-US">this</span><span style="font-size:8.0pt;font-family:" lang="EN-US">.element.show();</span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm; margin-left:35.4pt;margin-bottom:.0001pt;text-indent:35.4pt;line-height:normal; text-autospace:none"><span style="font-size:8.0pt;font-family:" lang="EN-US">this</span><span style="font-size:8.0pt;font-family:" lang="EN-US">.container.remove();</span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;text-autospace:none"><span style="font-size:8.0pt;font-family:" lang="EN-US">&#160;</span></p>
<p class="MsoNormal" style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm; margin-left:35.4pt;margin-bottom:.0001pt;text-indent:35.4pt;line-height:normal; text-autospace:none"><span style="font-size:8.0pt;font-family:" lang="EN-US">$.widget.prototype.destroy.apply(<span style="color: blue;">this</span>, arguments);</span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;text-autospace:none"><span style="font-size:8.0pt;font-family:" lang="EN-US">&#160;&#160;&#160;&#160;&#160;&#160; },</span></p>
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom:6.0pt; margin-left:0cm;line-height:normal"><span lang="EN-US">The reason of such changes is a new&#160; </span><strong><span style="font-size:10.0pt;font-family:" lang="EN-US">$.Widget</span></strong><span lang="EN-US"> introduced in jQuery 1.8 (see new jquery.ui.widget.js file from jquery-ui-1.8rc1). If you compare for example, jquery.ui.progressbar.js or from jquery-ui-1.8rc1 with ui.progressbar.js from jquery-ui-1.7.2 one can sees a differences.</span></p>
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom:6.0pt; margin-left:0cm;line-height:normal"><span lang="EN-US">Test whether </span><strong><span style="font-size: 10pt; font-family: &#34;Courier New&#34;;" lang="EN-US">$.Widget</span></strong><span lang="EN-US"> is defined I suggest to receive a code which works in both jquery-ui-1.7.2 and jquery-ui-1.8.</span></p>
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom:6.0pt; margin-left:0cm;line-height:normal"><span lang="EN-US">Best regards<br /> Oleg</span></p>
</div>
]]></description>
        	        	<pubDate>Tue, 16 Feb 2010 03:28:51 +0200</pubDate>
        </item>
        <item>
        	<title>tony on small bug in grid.jqueryui.js and ui.multiselect.js</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-grid-jqueryui-js-and-ui-multiselect-js#p14623</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-grid-jqueryui-js-and-ui-multiselect-js#p14623</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Thanks Oleg. Forgot to fix this in the last moment, but let wait for the final jQueru UI 1.8.</p>
<p>My opinion is not&#160; to cahnge the multiselect widget this way, but rather to set the fix in the grid file.</p>
</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 08 Feb 2010 12:14:32 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on small bug in grid.jqueryui.js and ui.multiselect.js</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-grid-jqueryui-js-and-ui-multiselect-js#p14593</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-grid-jqueryui-js-and-ui-multiselect-js#p14593</guid>
        	        	<description><![CDATA[<p>Hi Tony!</p>
</p>
<p>In grid.jqueryui.js line 225 should be fixed. Lines 224-225 looks currently like</p>
</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var <strong>mopts</strong> = $.isFunction(opts.msel_opts) ? opts.msel_opts.call(self, opts) : opts.msel_opts;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; call(opts.msel, select, <strong>opts.msel_opts</strong>);</p>
<p>The line 225 should be fixed to at least following</p>
</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; call(opts.msel, select, <strong>mopts</strong>);</p>
<p>Moreover in my tests with jquery-ui-1.8rc1 and jquery-1.4.js was mopts === undefined, which follows to errors inside of call(opts.msel, select, <strong>mopts</strong>). To fix the problem I had to make following changes:</p>
<p>In grid.jqueryui.js: the line 225 was repleced to the following 3 lines:</p>
</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (mopts === undefined) { mopts = {} }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (mopts.dividerLocation === undefined) { mopts.dividerLocation = 0.6; }</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; call(opts.msel, select, mopts);</p>
<p>(dividerLocation: 0.6 is the default value for dividerLocation, see line 300 of ui.multiselect.js).</p>
</p>
<p>Next change must be done inside of multiselect plugin. In ui.multiselect.js, in the function destroy the line 115 should be changed from</p>
<p>&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; $.widget.prototype.destroy.apply(this, arguments);</p>
<p>to</p>
<p>&#160;&#160; &#160;&#160;&#160;&#160; if ($.widget.prototype.destroy !== undefined)<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; $.widget.prototype.destroy.apply(this, arguments);</p>
</p>
<p>After the changes my project used jqGrid seems works with jquery-ui-1.8rc1 and jquery-1.4.1.js/jquery-1.4.js without any problems.</p>
<p>Best regards</p>
<p>Oleg</p>
]]></description>
        	        	<pubDate>Sat, 06 Feb 2010 00:33:23 +0200</pubDate>
        </item>
</channel>
</rss>