<?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: making columnChooser really resizable</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/making-columnchooser-really-resizable</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/making-columnchooser-really-resizable/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>fedorz on making columnChooser really resizable</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/making-columnchooser-really-resizable#p27682</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/making-columnchooser-really-resizable#p27682</guid>
        	        	<description><![CDATA[<p>Thanks Oleg,</p>
<p>This is really great, specially #3 allowing the real resizing of the ColumnChoose, which is important when there are many columns.</p>
</p>
<p>Tony,</p>
<p>Could this (#3) be added to one of the upcoming official releases? I hate to modify the code just to redo it everytime when there is a new version coming out.</p>
</p>
<p>Thanks,</p>
<p>Zoltan</p>
]]></description>
        	        	<pubDate>Thu, 08 Nov 2012 00:42:55 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on making columnChooser really resizable</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/making-columnchooser-really-resizable#p25823</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/making-columnchooser-really-resizable#p25823</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
<p>some recent questions which I answered pushed me to analyse the code of <strong>columnChooser</strong> and makes some bug fixes and improvements. The mosts benifit of the changes: the <strong>columnChooser</strong> will be really resizable.</p>
<p>I suggest to make the following changes in <em>grid.jqueryui.js</em>:</p>
<p>1) To fix <a href="https://github.com/tonytomov/jqGrid/blob/v4.3.1/js/grid.jqueryui.js#L117" target="_blank">the line</a></p>
<p><input type='button' class='sfcodeselect' name='sfselectit3414' value='Select Code' data-codeid='sfcode3414' /></p>
<div class='sfcode' id='sfcode3414'>if($(&#34;#colchooser_&#34;+self[0].p.id).length ) { return; }</div>
<p>to the following</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7131' value='Select Code' data-codeid='sfcode7131' /></p>
<div class='sfcode' id='sfcode7131'>if($(&#34;#colchooser_&#34;+<strong>$.jgrid.jqID(</strong>self[0].p.id)<strong>)</strong>.length ) { return; }</div>
<p>2) The current option <strong>dlog_opts</strong> of the&#160;<strong>columnChooser</strong>&#160;has an important disadvantage. One can&#39;t add new option of the jQuery UI dialog without ovewriting of the whole <strong>dlog_opts</strong>&#160;functions which has many internal implementation details like call of <strong>opts.cleanup</strong> for example. I suggest to add new option dialog_opts which will be merged with the results of <strong>dlog_opts</strong>.</p>
<p>In the way one will be able to use jQuery UI dialog in very easy way. For example like the following</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5346' value='Select Code' data-codeid='sfcode5346' /></p>
<div class='sfcode' id='sfcode5346'>dialog_opts: {<br />&#160; &#160; minWidth: 470,<br />&#160; &#160; show: &#39;blind&#39;,<br />&#160; &#160; hide: &#39;explode&#39;<br />}</div>
<p>3) Make some additional changes to make the Column Chooser dialog really resizable. To do this I suggest the following additional changes:</p>
<p>- replaces <a href="https://github.com/tonytomov/jqGrid/blob/v4.3.1/js/grid.jqueryui.js#L165-173" target="_blank">the lines</a></p>
<p><input type='button' class='sfcodeselect' name='sfselectit5014' value='Select Code' data-codeid='sfcode5014' /></p>
<div class='sfcode' id='sfcode5014'>return {<br />&#160; &#160; &#34;buttons&#34;: buttons,<br />&#160; &#160; &#34;close&#34;: function() {<br />&#160; &#160; &#160; &#160; opts.cleanup(true);<br />&#160; &#160; },<br />&#160; &#160; &#34;modal&#34; : opts.modal ? opts.modal : false,<br />&#160; &#160; &#34;resizable&#34;: opts.resizable ? opts.resizable : true,<br />&#160; &#160; &#34;width&#34;: opts.width+20<br />};</div>
<p>to the following</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8132' value='Select Code' data-codeid='sfcode8132' /></p>
<div class='sfcode' id='sfcode8132'>return <strong>$.extend(true,</strong> {<br />&#160; &#160; &#34;buttons&#34;: buttons,<br />&#160; &#160; &#34;close&#34;: function() {<br />&#160; &#160; &#160; &#160; opts.cleanup(true);<br />&#160; &#160; },<br />&#160; &#160; &#34;modal&#34; : opts.modal ? opts.modal : false,<br />&#160; &#160; &#34;resizable&#34;: opts.resizable ? opts.resizable : true,<br />&#160; &#160; &#34;width&#34;: opts.width+20<strong>,<br />&#160; &#160; resize: function (e, ui) {<br />&#160; &#160; &#160; &#160; var $container = $(this).find(&#39;&#62;div&#62;div.ui-multiselect&#39;),<br />&#160; &#160; &#160; &#160; &#160; &#160; containerWidth = $container.width(),<br />&#160; &#160; &#160; &#160; &#160; &#160; containerHeight = $container.height(),<br />&#160; &#160; &#160; &#160; &#160; &#160; $selectedContainer = $container.find(&#39;&#62;div.selected&#39;),<br />&#160; &#160; &#160; &#160; &#160; &#160; $availableContainer = $container.find(&#39;&#62;div.available&#39;),<br />&#160; &#160; &#160; &#160; &#160; &#160; $selectedActions = $selectedContainer.find(&#39;&#62;div.actions&#39;),<br />&#160; &#160; &#160; &#160; &#160; &#160; $availableActions = $availableContainer.find(&#39;&#62;div.actions&#39;),<br />&#160; &#160; &#160; &#160; &#160; &#160; $selectedList = $selectedContainer.find(&#39;&#62;ul.connected-list&#39;),<br />&#160; &#160; &#160; &#160; &#160; &#160; $availableList = $availableContainer.find(&#39;&#62;ul.connected-list&#39;),<br />&#160; &#160; &#160; &#160; &#160; &#160; dividerLocation = opts.msel_opts.dividerLocation &#124;&#124; $.ui.multiselect.defaults.dividerLocation;</p>
<p>&#160; &#160; &#160; &#160; $container.width(containerWidth); // to fix width like 398.96px<br />&#160; &#160; &#160; &#160; $availableContainer.width(Math.floor(containerWidth*(1-dividerLocation)));<br />&#160; &#160; &#160; &#160; $selectedContainer.width(containerWidth - $availableContainer.outerWidth() - ($.browser.webkit ? 1: 0));</p>
<p>&#160; &#160; &#160; &#160; $availableContainer.height(containerHeight);<br />&#160; &#160; &#160; &#160; $selectedContainer.height(containerHeight);<br />&#160; &#160; &#160; &#160; $selectedList.height(Math.max(containerHeight-$selectedActions.outerHeight()-1,1));<br />&#160; &#160; &#160; &#160; $availableList.height(Math.max(containerHeight-$availableActions.outerHeight()-1,1));</p>
<p></strong><br />&#160; &#160; <strong>}</strong><br />}<strong>, opts.dialog_opts &#124;&#124; {})</strong>;&#160;</div>
<p>- add some additional lines <a href="https://github.com/tonytomov/jqGrid/blob/v4.3.1/js/grid.jqueryui.js#L269" target="_blank">at the end</a> of the <strong>columnChooser</strong>&#160;function:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9615' value='Select Code' data-codeid='sfcode9615' /></p>
<div class='sfcode' id='sfcode9615'><strong>// fix height of elements of the multiselect widget<br />var resizeSel = &#34;#colchooser_&#34;+$.jgrid.jqID(self[0].p.id),<br />&#160; &#160; $container = $(resizeSel + &#39;&#62;div&#62;div.ui-multiselect&#39;),<br />&#160; &#160; $selectedContainer = $(resizeSel + &#39;&#62;div&#62;div.ui-multiselect&#62;div.selected&#39;),<br />&#160; &#160; $availableContainer = $(resizeSel + &#39;&#62;div&#62;div.ui-multiselect&#62;div.available&#39;),<br />&#160; &#160; containerHeight = $container.height(),<br />&#160; &#160; $selectedActions = $selectedContainer.find(&#39;&#62;div.actions&#39;),<br />&#160; &#160; $availableActions = $availableContainer.find(&#39;&#62;div.actions&#39;),<br />&#160; &#160; $selectedList = $selectedContainer.find(&#39;&#62;ul.connected-list&#39;),<br />&#160; &#160; $availableList = $availableContainer.find(&#39;&#62;ul.connected-list&#39;);<br />$container.height($container.parent().height()); // increase the container height<br />containerHeight = $container.height();<br />$selectedContainer.height(containerHeight);<br />$availableContainer.height(containerHeight);<br />$selectedList.height(Math.max(containerHeight-$selectedActions.outerHeight()-1,1));<br />$availableList.height(Math.max(containerHeight-$availableActions.outerHeight()-1,1));<br />// extend the list of components which will be also-resized<br />selector.data(&#39;dialog&#39;).uiDialog.resizable(&#34;option&#34;, &#34;alsoResize&#34;,<br />&#160; &#160; resizeSel + &#39;,&#39; + resizeSel +&#39;&#62;div&#39; + &#39;,&#39; + resizeSel + &#39;&#62;div&#62;div.ui-multiselect&#39;);&#160;</strong></div>
<p>One can see on <a href="http://www.ok-soft-gmbh.com/jqGrid/SimpleLocalGridWithColumnChooser4_.htm" target="_blank">the demo</a> live the results of the changes.</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Fri, 27 Jan 2012 15:41:12 +0200</pubDate>
        </item>
</channel>
</rss>