<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Flexigrid jQuery plugin: extending to allow sorting of static grids</title>
	<atom:link href="http://pixelnix.com/flexigrid-jquery-plugin-extending-to-allow-sorting-of-static-grids/feed/" rel="self" type="application/rss+xml" />
	<link>http://pixelnix.com/flexigrid-jquery-plugin-extending-to-allow-sorting-of-static-grids/</link>
	<description></description>
	<lastBuildDate>Fri, 23 Jul 2010 15:37:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: tancs</title>
		<link>http://pixelnix.com/flexigrid-jquery-plugin-extending-to-allow-sorting-of-static-grids/comment-page-1/#comment-254</link>
		<dc:creator>tancs</dc:creator>
		<pubDate>Thu, 01 Jul 2010 03:40:21 +0000</pubDate>
		<guid isPermaLink="false">http://pixelnix.com/?p=74#comment-254</guid>
		<description>sorry nick....

miss out some portions...
(else if (!p.url)
this.inPlaceSort();)

it work....



millions thanks........</description>
		<content:encoded><![CDATA[<p>sorry nick&#8230;.</p>
<p>miss out some portions&#8230;<br />
(else if (!p.url)<br />
this.inPlaceSort();)</p>
<p>it work&#8230;.</p>
<p>millions thanks&#8230;&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tancs</title>
		<link>http://pixelnix.com/flexigrid-jquery-plugin-extending-to-allow-sorting-of-static-grids/comment-page-1/#comment-253</link>
		<dc:creator>tancs</dc:creator>
		<pubDate>Thu, 01 Jul 2010 03:28:44 +0000</pubDate>
		<guid isPermaLink="false">http://pixelnix.com/?p=74#comment-253</guid>
		<description>Thanks nick.....

but i tried with example.....and it was not allow to sort the rows........but the css was working good..

thanks
tancs</description>
		<content:encoded><![CDATA[<p>Thanks nick&#8230;..</p>
<p>but i tried with example&#8230;..and it was not allow to sort the rows&#8230;&#8230;..but the css was working good..</p>
<p>thanks<br />
tancs</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://pixelnix.com/flexigrid-jquery-plugin-extending-to-allow-sorting-of-static-grids/comment-page-1/#comment-230</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Fri, 11 Jun 2010 22:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://pixelnix.com/?p=74#comment-230</guid>
		<description>Russell,

The patched version of flexigrid should work just like the original flexigrid.  Lets say your page has a table with id myTbl, with just the table contents, no header row; you could turn it into a flexigrid with some JS code like:
[code]
$(&quot;#myTbl&quot;).flexigrid({
        colModel : [
            {display: &#039;Column A&#039;, name : &#039;columnA&#039;, width : 150, sortable : true, align: &#039;left&#039;},
            {display: &#039;Column B&#039;, name : &#039;columnB&#039;, width : 150, sortable : true, align: &#039;left&#039;},
            {display: &#039;Column C&#039;, name : &#039;columnC&#039;, width : 100, sortable : false, align: &#039;left&#039;}
        ],
        sortname: &quot;&quot;,
        sortorder: &quot;asc&quot;,
        usepager: false,
        title: &#039;My Table Title&#039;,
        useRp: false,
        showTableToggleBtn: true,
        width: &#039;auto&#039;,
        height: &#039;auto&#039;

    });
[/code]
That&#039;d be for a table with 3 columns, where the first two columns can be used for sorting.  The idea is that the static contents of the grid should be sortable, without connecting it up to an ajax data source.</description>
		<content:encoded><![CDATA[<p>Russell,</p>
<p>The patched version of flexigrid should work just like the original flexigrid.  Lets say your page has a table with id myTbl, with just the table contents, no header row; you could turn it into a flexigrid with some JS code like:<br />
[code]<br />
$("#myTbl").flexigrid({<br />
        colModel : [<br />
            {display: 'Column A', name : 'columnA', width : 150, sortable : true, align: 'left'},<br />
            {display: 'Column B', name : 'columnB', width : 150, sortable : true, align: 'left'},<br />
            {display: 'Column C', name : 'columnC', width : 100, sortable : false, align: 'left'}<br />
        ],<br />
        sortname: "",<br />
        sortorder: "asc",<br />
        usepager: false,<br />
        title: 'My Table Title',<br />
        useRp: false,<br />
        showTableToggleBtn: true,<br />
        width: 'auto',<br />
        height: 'auto'</p>
<p>    });<br />
[/code]<br />
That&#8217;d be for a table with 3 columns, where the first two columns can be used for sorting.  The idea is that the static contents of the grid should be sortable, without connecting it up to an ajax data source.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Russell</title>
		<link>http://pixelnix.com/flexigrid-jquery-plugin-extending-to-allow-sorting-of-static-grids/comment-page-1/#comment-227</link>
		<dc:creator>Russell</dc:creator>
		<pubDate>Wed, 09 Jun 2010 14:44:30 +0000</pubDate>
		<guid isPermaLink="false">http://pixelnix.com/?p=74#comment-227</guid>
		<description>Has anyone got an example of using this patched code. I have updated the script but can&#039;t get it to work.

thanks.</description>
		<content:encoded><![CDATA[<p>Has anyone got an example of using this patched code. I have updated the script but can&#8217;t get it to work.</p>
<p>thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doc</title>
		<link>http://pixelnix.com/flexigrid-jquery-plugin-extending-to-allow-sorting-of-static-grids/comment-page-1/#comment-160</link>
		<dc:creator>Doc</dc:creator>
		<pubDate>Wed, 07 Apr 2010 16:17:12 +0000</pubDate>
		<guid isPermaLink="false">http://pixelnix.com/?p=74#comment-160</guid>
		<description>Hi,

Thank you for your patch, it&#039;s what I was looking for.

Here&#039;s your code updated with my changes. I&#039;ve added a parameter to &#039;inPlaceSort&#039;, so I can use the &#039;axis&#039; attribute, and I&#039;ve put the &quot;if (p.sortorder==&#039;asc&#039;)&quot; test outside the &quot;rows.sort&quot; callback :

...
else if (!p.url) this.inPlaceSort(th);
...
inPlaceSort: function(th) {

if (!p.sortorder) p.sortorder=&#039;asc&#039;;

var col = $(th).attr(&#039;axis&#039;).substr(3);
var rows = $(this.bDiv).find(&#039;tr&#039;);
if ((!rows) &#124;&#124; (rows.length &lt; 2)) return true;

var parent = $(rows[0]).parent();

// Hat tip http://www.onemoretake.com/2009/02/25/sorting-elements-with-jquery/
// This comparator could be a lot more sophisticated.  How about adding 
// a property of the column model that says if the data is numeric or textual,
// then sorting based on that?  TODO: yeah.
var orderby = -1;
if (p.sortorder==&#039;asc&#039;) orderby = 1;

rows.sort(function(a, b) {
    var compA = $(a).find(&quot;td:eq(&quot;+col+&quot;)&quot;).text();
    var compB = $(b).find(&quot;td:eq(&quot;+col+&quot;)&quot;).text();
    return (compA  compB) ? -orderby : 0;
});
  
$.each(rows, function() {
    $(parent).append(this);
});
},</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Thank you for your patch, it&#8217;s what I was looking for.</p>
<p>Here&#8217;s your code updated with my changes. I&#8217;ve added a parameter to &#8216;inPlaceSort&#8217;, so I can use the &#8216;axis&#8217; attribute, and I&#8217;ve put the &#8220;if (p.sortorder==&#8217;asc&#8217;)&#8221; test outside the &#8220;rows.sort&#8221; callback :</p>
<p>&#8230;<br />
else if (!p.url) this.inPlaceSort(th);<br />
&#8230;<br />
inPlaceSort: function(th) {</p>
<p>if (!p.sortorder) p.sortorder=&#8217;asc&#8217;;</p>
<p>var col = $(th).attr(&#8216;axis&#8217;).substr(3);<br />
var rows = $(this.bDiv).find(&#8216;tr&#8217;);<br />
if ((!rows) || (rows.length &lt; 2)) return true;</p>
<p>var parent = $(rows[0]).parent();</p>
<p>// Hat tip <a href="http://www.onemoretake.com/2009/02/25/sorting-elements-with-jquery/" rel="nofollow">http://www.onemoretake.com/2009/02/25/sorting-elements-with-jquery/</a><br />
// This comparator could be a lot more sophisticated.  How about adding<br />
// a property of the column model that says if the data is numeric or textual,<br />
// then sorting based on that?  TODO: yeah.<br />
var orderby = -1;<br />
if (p.sortorder==&#039;asc&#039;) orderby = 1;</p>
<p>rows.sort(function(a, b) {<br />
    var compA = $(a).find(&quot;td:eq(&quot;+col+&quot;)&quot;).text();<br />
    var compB = $(b).find(&quot;td:eq(&quot;+col+&quot;)&quot;).text();<br />
    return (compA  compB) ? -orderby : 0;<br />
});</p>
<p>$.each(rows, function() {<br />
    $(parent).append(this);<br />
});<br />
},</p>
]]></content:encoded>
	</item>
</channel>
</rss>
