<?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: Problems with YUI DataTable</title>
	<atom:link href="http://www.zachleat.com/web/problems-with-yui-datatable/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zachleat.com/web/problems-with-yui-datatable/</link>
	<description></description>
	<lastBuildDate>Wed, 16 May 2012 21:15:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: Rudi</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-2264</link>
		<dc:creator>Rudi</dc:creator>
		<pubDate>Sat, 19 Feb 2011 05:20:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-2264</guid>
		<description>Hi Zach, 

  Nice article. Thanks for sharing. 

  Do you happen to know how I can refresh a YUI datatable from the code? not using a subscribe to an event. 

  I have code to do a requery that works fine. However, I also have code to perform a database update on a click. I would like to refresh the datatable contents after that database update. 

  Thanks in advance. 

Best regards, 

Rudi</description>
		<content:encoded><![CDATA[<p>Hi Zach, </p>
<p>  Nice article. Thanks for sharing. </p>
<p>  Do you happen to know how I can refresh a YUI datatable from the code? not using a subscribe to an event. </p>
<p>  I have code to do a requery that works fine. However, I also have code to perform a database update on a click. I would like to refresh the datatable contents after that database update. </p>
<p>  Thanks in advance. </p>
<p>Best regards, </p>
<p>Rudi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mits</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-1711</link>
		<dc:creator>Mits</dc:creator>
		<pubDate>Fri, 20 Nov 2009 18:13:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-1711</guid>
		<description>Hi Zach,
1) 
I have created a table with one row nested inside a column of the data table.
User can Insert and delete rows in the table (as I have provided those options in menu).

Problem: If I select multiple rows , I am not able to fetch the data of the table (which is nested within a olumn).
PLease tell me how can I access the data in the table nested within the column of a datatable.When multiple rows are selected.

2) If have used the functions updateRow() or UpdateRecords() for pasting the data from one row into another. 
The problem of using these functions in Paste option is that these two functions update the row of the datatable BUT it also keep updating the rows even when I make changes in the copied row later.
PLEASE HELP ME ON THIS URGENTLY

THanks in advance :)</description>
		<content:encoded><![CDATA[<p>Hi Zach,<br />
1)<br />
I have created a table with one row nested inside a column of the data table.<br />
User can Insert and delete rows in the table (as I have provided those options in menu).</p>
<p>Problem: If I select multiple rows , I am not able to fetch the data of the table (which is nested within a olumn).<br />
PLease tell me how can I access the data in the table nested within the column of a datatable.When multiple rows are selected.</p>
<p>2) If have used the functions updateRow() or UpdateRecords() for pasting the data from one row into another.<br />
The problem of using these functions in Paste option is that these two functions update the row of the datatable BUT it also keep updating the rows even when I make changes in the copied row later.<br />
PLEASE HELP ME ON THIS URGENTLY</p>
<p>THanks in advance :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chi</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-1706</link>
		<dc:creator>Chi</dc:creator>
		<pubDate>Tue, 03 Nov 2009 21:52:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-1706</guid>
		<description>Thank you Zach for that tip!  Ya, seems like they don&#039;t want the horizontal scrollbar anymore now :)</description>
		<content:encoded><![CDATA[<p>Thank you Zach for that tip!  Ya, seems like they don&#8217;t want the horizontal scrollbar anymore now :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach Leatherman</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-1701</link>
		<dc:creator>Zach Leatherman</dc:creator>
		<pubDate>Sat, 31 Oct 2009 18:05:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-1701</guid>
		<description>Are you sure horizontal scrolling is necessary for your use case?

Usability above precedence.
http://www.useit.com/alertbox/20050711.html</description>
		<content:encoded><![CDATA[<p>Are you sure horizontal scrolling is necessary for your use case?</p>
<p>Usability above precedence.<br />
<a href="http://www.useit.com/alertbox/20050711.html" rel="nofollow">http://www.useit.com/alertbox/20050711.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chi</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-1698</link>
		<dc:creator>Chi</dc:creator>
		<pubDate>Mon, 26 Oct 2009 21:33:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-1698</guid>
		<description>Hi, 

I am currently also looking into the &quot;column freeze&quot; feature you talked about (&quot;if the table is going to scroll horizontally, allow the developer to freeze a column or multiple columns so that they are shown when scrolling from left to right.&quot;)

Do you know if it is doable with the current YUI version, or any possible workarounds? 

Thanks,
Chi</description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>I am currently also looking into the &#8220;column freeze&#8221; feature you talked about (&#8220;if the table is going to scroll horizontally, allow the developer to freeze a column or multiple columns so that they are shown when scrolling from left to right.&#8221;)</p>
<p>Do you know if it is doable with the current YUI version, or any possible workarounds? </p>
<p>Thanks,<br />
Chi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach Leatherman</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-1642</link>
		<dc:creator>Zach Leatherman</dc:creator>
		<pubDate>Fri, 11 Sep 2009 02:31:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-1642</guid>
		<description>Hey Keesjan,
Again, I think the best way to get help is on the YUI mailing lists.  As far as I know, they&#039;re still active!

Thanks,
Zach</description>
		<content:encoded><![CDATA[<p>Hey Keesjan,<br />
Again, I think the best way to get help is on the YUI mailing lists.  As far as I know, they&#8217;re still active!</p>
<p>Thanks,<br />
Zach</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keesjan Deelstra</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-1640</link>
		<dc:creator>Keesjan Deelstra</dc:creator>
		<pubDate>Thu, 10 Sep 2009 10:33:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-1640</guid>
		<description>Hi Zach,
readint this post about (old) YUI datatable limitations. I was searching google for &quot;yui datatable headers tooltips&quot;. And thats excactly what I want to complete.
Do you now of ways to achieve that?
I want to make question icons in each header to make help tooltips. Hope you are still &#039;into&#039; YUI....</description>
		<content:encoded><![CDATA[<p>Hi Zach,<br />
readint this post about (old) YUI datatable limitations. I was searching google for &#8220;yui datatable headers tooltips&#8221;. And thats excactly what I want to complete.<br />
Do you now of ways to achieve that?<br />
I want to make question icons in each header to make help tooltips. Hope you are still &#8216;into&#8217; YUI&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ansar</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-1197</link>
		<dc:creator>Ansar</dc:creator>
		<pubDate>Sun, 02 Aug 2009 06:11:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-1197</guid>
		<description>hiii,
i have a problem with my datatable.my datatable updates its content every 5 seconds, but on updating the client-side sorting modified by the  user gets reset to server default.

i want the sort key the client sets to be set even after data refresh.If u have a solution please help me.This is the code




	YUI Library Examples: DataTable Control: Basic Example
    

    

&lt;!--Script and CSS includes for YUI dependencies on this page--&gt;






 








&lt;!--begin custom header content for this example--&gt;

/* custom styles for this example */
.yui-skin-sam .yui-dt-liner { white-space:nowrap; } 



/* Remove row striping, column borders, and sort highlighting */
/* .yui-skin-sam tr.yui-dt-odd,
.yui-skin-sam tr.yui-dt-odd td.yui-dt-asc,
.yui-skin-sam tr.yui-dt-odd td.yui-dt-desc,
.yui-skin-sam tr.yui-dt-even td.yui-dt-asc,
.yui-skin-sam tr.yui-dt-even td.yui-dt-desc {
    background-color: #fff;
}*/
.yui-skin-sam .yui-dt tbody td {
    border-bottom: 1px solid #fff;
}
.yui-skin-sam .yui-dt thead th {
    border-bottom: 1px solid #7f7f7f;
}
.yui-skin-sam .yui-dt tr.yui-dt-last td,
.yui-skin-sam .yui-dt th,
.yui-skin-sam .yui-dt td {
    border: none;
}

/* Class for marked rows */

.yui-skin-sam .yui-dt tr.mark td.yui-dt0-col-Price,
.yui-skin-sam .yui-dt tr.mark td.yui-dt0-col-Price,
.yui-skin-sam .yui-dt tr.mark td.yui-dt0-col-Price,
.yui-skin-sam .yui-dt tr.mark td.yui-dt0-col-Price {
    background-color: #891010;
    color: #fff;
}

.yui-skin-sam .yui-dt tr.m td.yui-dt0-col-Price,
.yui-skin-sam .yui-dt tr.m td.yui-dt0-col-Price,
.yui-skin-sam .yui-dt tr.m td.yui-dt0-col-Price,
.yui-skin-sam .yui-dt tr.m td.yui-dt0-col-Price {
    background-color: #108918;
    color: #fff;
}

&lt;!--end custom header content for this example--&gt;



		
	&lt;!--BEGIN SOURCE CODE FOR EXAMPLE =============================== --&gt;
	
	



var Dom = YAHOO.util.Dom; 
YAHOO.util.Event.addListener(window, &quot;load&quot;, function() {
    YAHOO.example.XHR_Text = function() {
      

        var myColumnDefs = [
            {key:&quot;Stock&quot;,  sortable:true, resizeable:true},
			{key:&quot;Price&quot;,  sortable:true, resizeable:true},
           {key:&quot;Per.Change&quot;, label:&quot;%Change&quot;, sortable:true, resizeable:true},
            {key:&quot;Change&quot;,  sortable:true, resizeable:true}, 
            {key:&quot;High&quot;, sortable:true, resizeable:true},
			{key:&quot;Low&quot;,  sortable:true, resizeable:true},
            {key:&quot;Volume&quot;,  sortable:true, resizeable:true}

        ];

        myDataSource = new YAHOO.util.DataSource(&quot;assets/js/price1.txt&quot;);
        myDataSource.responseType = YAHOO.util.DataSource.TYPE_TEXT;
        myDataSource.responseSchema = {
            recordDelim: &quot;&#124;;&quot;,
            fieldDelim: &quot;;&quot;,
            fields: [{key:&quot;Stock&quot;, parser:&quot;string&quot;},
            {key:&quot;Price&quot;, parser:&quot;number&quot;}, 
            {key:&quot;Volume&quot;},   
            {key:&quot;Per.Change&quot;, parser:&quot;number&quot;},
			{key:&quot;Change&quot;, parser:&quot;number&quot;},
            {key:&quot;High&quot;, parser:&quot;number&quot;}, 
            {key:&quot;Low&quot;, parser:&quot;number&quot;}
            
  ]   

        };
		
	var myRowFormatter = function(elTr, oRecord) {
    if (oRecord.getData(&quot;Price&quot;)  640) {
        Dom.addClass(elTr, &#039;m&#039;);
    }
    return true;
}; 
		
        myDataTable = new YAHOO.widget.DataTable(&quot;basic&quot;, myColumnDefs,
                myDataSource, {caption:&quot;MarketWatch&quot;, formatRow: myRowFormatter, draggableColumns:true });

                // Subscribe to events for row selection
        myDataTable.subscribe(&quot;rowMouseoverEvent&quot;, myDataTable.onEventHighlightRow);
        myDataTable.subscribe(&quot;rowMouseoutEvent&quot;, myDataTable.onEventUnhighlightRow);
        myDataTable.subscribe(&quot;rowClickEvent&quot;, myDataTable.onEventSelectRow);

        // Programmatically select the first row
        myDataTable.selectRow(myDataTable.getTrEl(0));
        // Programmatically bring focus to the instance so arrow selection works immediately
        myDataTable.focus();
		
 var myCallback = {   
             success: myDataTable.onDataReturnSetRows, 

             scope: myDataTable,  			 
             failure: function() {   
                 YAHOO.log(&quot;Polling failure&quot;, &quot;error&quot;);   
             }  
			
       }  
       myDataSource.setInterval(5000,null, myCallback)   

        return {
            oDS: myDataSource,
            oDT: myDataTable
        };
    }();
});






</description>
		<content:encoded><![CDATA[<p>hiii,<br />
i have a problem with my datatable.my datatable updates its content every 5 seconds, but on updating the client-side sorting modified by the  user gets reset to server default.</p>
<p>i want the sort key the client sets to be set even after data refresh.If u have a solution please help me.This is the code</p>
<p>	YUI Library Examples: DataTable Control: Basic Example</p>
<p><!--Script and CSS includes for YUI dependencies on this page--></p>
<p><!--begin custom header content for this example--></p>
<p>/* custom styles for this example */<br />
.yui-skin-sam .yui-dt-liner { white-space:nowrap; } </p>
<p>/* Remove row striping, column borders, and sort highlighting */<br />
/* .yui-skin-sam tr.yui-dt-odd,<br />
.yui-skin-sam tr.yui-dt-odd td.yui-dt-asc,<br />
.yui-skin-sam tr.yui-dt-odd td.yui-dt-desc,<br />
.yui-skin-sam tr.yui-dt-even td.yui-dt-asc,<br />
.yui-skin-sam tr.yui-dt-even td.yui-dt-desc {<br />
    background-color: #fff;<br />
}*/<br />
.yui-skin-sam .yui-dt tbody td {<br />
    border-bottom: 1px solid #fff;<br />
}<br />
.yui-skin-sam .yui-dt thead th {<br />
    border-bottom: 1px solid #7f7f7f;<br />
}<br />
.yui-skin-sam .yui-dt tr.yui-dt-last td,<br />
.yui-skin-sam .yui-dt th,<br />
.yui-skin-sam .yui-dt td {<br />
    border: none;<br />
}</p>
<p>/* Class for marked rows */</p>
<p>.yui-skin-sam .yui-dt tr.mark td.yui-dt0-col-Price,<br />
.yui-skin-sam .yui-dt tr.mark td.yui-dt0-col-Price,<br />
.yui-skin-sam .yui-dt tr.mark td.yui-dt0-col-Price,<br />
.yui-skin-sam .yui-dt tr.mark td.yui-dt0-col-Price {<br />
    background-color: #891010;<br />
    color: #fff;<br />
}</p>
<p>.yui-skin-sam .yui-dt tr.m td.yui-dt0-col-Price,<br />
.yui-skin-sam .yui-dt tr.m td.yui-dt0-col-Price,<br />
.yui-skin-sam .yui-dt tr.m td.yui-dt0-col-Price,<br />
.yui-skin-sam .yui-dt tr.m td.yui-dt0-col-Price {<br />
    background-color: #108918;<br />
    color: #fff;<br />
}</p>
<p><!--end custom header content for this example--></p>
<p>	<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== --></p>
<p>var Dom = YAHOO.util.Dom;<br />
YAHOO.util.Event.addListener(window, &#8220;load&#8221;, function() {<br />
    YAHOO.example.XHR_Text = function() {</p>
<p>        var myColumnDefs = [<br />
            {key:"Stock",  sortable:true, resizeable:true},<br />
			{key:"Price",  sortable:true, resizeable:true},<br />
           {key:"Per.Change", label:"%Change", sortable:true, resizeable:true},<br />
            {key:"Change",  sortable:true, resizeable:true},<br />
            {key:"High", sortable:true, resizeable:true},<br />
			{key:"Low",  sortable:true, resizeable:true},<br />
            {key:"Volume",  sortable:true, resizeable:true}</p>
<p>        ];</p>
<p>        myDataSource = new YAHOO.util.DataSource(&#8220;assets/js/price1.txt&#8221;);<br />
        myDataSource.responseType = YAHOO.util.DataSource.TYPE_TEXT;<br />
        myDataSource.responseSchema = {<br />
            recordDelim: &#8220;|;&#8221;,<br />
            fieldDelim: &#8220;;&#8221;,<br />
            fields: [{key:"Stock", parser:"string"},<br />
            {key:"Price", parser:"number"},<br />
            {key:"Volume"},<br />
            {key:"Per.Change", parser:"number"},<br />
			{key:"Change", parser:"number"},<br />
            {key:"High", parser:"number"},<br />
            {key:"Low", parser:"number"}</p>
<p>  ]   </p>
<p>        };</p>
<p>	var myRowFormatter = function(elTr, oRecord) {<br />
    if (oRecord.getData(&#8220;Price&#8221;)  640) {<br />
        Dom.addClass(elTr, &#8216;m&#8217;);<br />
    }<br />
    return true;<br />
}; </p>
<p>        myDataTable = new YAHOO.widget.DataTable(&#8220;basic&#8221;, myColumnDefs,<br />
                myDataSource, {caption:&#8221;MarketWatch&#8221;, formatRow: myRowFormatter, draggableColumns:true });</p>
<p>                // Subscribe to events for row selection<br />
        myDataTable.subscribe(&#8220;rowMouseoverEvent&#8221;, myDataTable.onEventHighlightRow);<br />
        myDataTable.subscribe(&#8220;rowMouseoutEvent&#8221;, myDataTable.onEventUnhighlightRow);<br />
        myDataTable.subscribe(&#8220;rowClickEvent&#8221;, myDataTable.onEventSelectRow);</p>
<p>        // Programmatically select the first row<br />
        myDataTable.selectRow(myDataTable.getTrEl(0));<br />
        // Programmatically bring focus to the instance so arrow selection works immediately<br />
        myDataTable.focus();</p>
<p> var myCallback = {<br />
             success: myDataTable.onDataReturnSetRows, </p>
<p>             scope: myDataTable,<br />
             failure: function() {<br />
                 YAHOO.log(&#8220;Polling failure&#8221;, &#8220;error&#8221;);<br />
             }  </p>
<p>       }<br />
       myDataSource.setInterval(5000,null, myCallback)   </p>
<p>        return {<br />
            oDS: myDataSource,<br />
            oDT: myDataTable<br />
        };<br />
    }();<br />
});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Edward</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-1104</link>
		<dc:creator>Edward</dc:creator>
		<pubDate>Mon, 27 Jul 2009 11:06:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-1104</guid>
		<description>Hallo, please help me. I could not reload right the DataSource of the DataTable component. The DataSource I get from mySQl. When I want to refresh my data (previously change some data into the base) using methods above or just by reloading the page (F5), nothig was happen. I have took into acount that when I click to the field for sorting: in one direction it show right result...in another - old list of data...This is my code:
// Code example
YAHOO.example.DynamicData = function() {
    // Column definitions
    var myColumnDefs = [ // sortable:true enables sorting
        {key:&quot;ID&quot;, label:&quot;ID&quot;, sortable:true},
        {key:&quot;Date&quot;, label:&quot;Date&quot;, sortable:true},
        {key:&quot;Time&quot;, label:&quot;Time&quot; /*, formatter:&quot;date&quot;*/ },
        {key:&quot;TotalCharge&quot;, label:&quot;TotalCharge&quot;, sortable:true},
	{key:&quot;TotalEnergy&quot;, label:&quot;TotalEnergy&quot;, sortable:true},
	{key:&quot;MaxPeak&quot;, label:&quot;MaxPeak&quot;, sortable:true},
	{key:&quot;NumbOfStrokes&quot;, label:&quot;NumbOfStrokes&quot;, sortable:true},
        {key:&quot;jpgID&quot;, label:&quot;jpgID&quot;, sortable:true}
    ];

    // Custom parser
    var stringToDate = function(sData) {
        var array = sData.split(&quot;-&quot;);
        return new Date(array[1] + &quot; &quot; + array[0] + &quot;, &quot; + array[2]);
    };
    
    // DataSource instance
    var myDataSource = new YAHOO.util.DataSource(&quot;json_proxy.php?&quot;);
    myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
    myDataSource.responseSchema = {
        resultsList: &quot;records&quot;,
        fields: [
		{key:&quot;ID&quot;, parser:&quot;number&quot;},
		{key:&quot;Date&quot;},
		{key:&quot;Time&quot; /*parser:stringToDate*/ },
		{key:&quot;TotalCharge&quot;,parser:&quot;number&quot;},
		{key:&quot;TotalEnergy&quot;,parser:&quot;number&quot;},
		{key:&quot;MaxPeak&quot;,parser:&quot;number&quot;},
		{key:&quot;NumbOfStrokes&quot;,parser:&quot;number&quot;},
		{key:&quot;jpgID&quot;}
        ],
        metaFields: {
            totalRecords: &quot;totalRecords&quot; // Access to value in the server response
        }
    };
    
    // DataTable configuration
    var myConfigs = {
        initialRequest: &quot;sort=ID&amp;dir=asc&amp;startIndex=0&amp;results=25&quot;, // Initial request for first page of data
        dynamicData: true, // Enables dynamic server-driven data
        sortedBy : {key:&quot;ID&quot;, dir:YAHOO.widget.DataTable.CLASS_ASC}, // Sets UI initial sort arrow
        paginator: new YAHOO.widget.Paginator({ rowsPerPage:25 }) // Enables pagination 
    };
    
    // DataTable instance
    var myDataTable = new YAHOO.widget.DataTable(&quot;dynamicdata&quot;, myColumnDefs, myDataSource, myConfigs);
    // Update totalRecords on the fly with value from server
    myDataTable.handleDataReturnPayload = function(oRequest, oResponse, oPayload) {
        oPayload.totalRecords = oResponse.meta.totalRecords;
        return oPayload;
    }
    
    return {
        ds: myDataSource,
        dt: myDataTable
    };
        
}();

Please anyone explain what and where I must put a code for refreshings? Thank&#039;s.</description>
		<content:encoded><![CDATA[<p>Hallo, please help me. I could not reload right the DataSource of the DataTable component. The DataSource I get from mySQl. When I want to refresh my data (previously change some data into the base) using methods above or just by reloading the page (F5), nothig was happen. I have took into acount that when I click to the field for sorting: in one direction it show right result&#8230;in another &#8211; old list of data&#8230;This is my code:<br />
// Code example<br />
YAHOO.example.DynamicData = function() {<br />
    // Column definitions<br />
    var myColumnDefs = [ // sortable:true enables sorting<br />
        {key:"ID", label:"ID", sortable:true},<br />
        {key:"Date", label:"Date", sortable:true},<br />
        {key:"Time", label:"Time" /*, formatter:"date"*/ },<br />
        {key:"TotalCharge", label:"TotalCharge", sortable:true},<br />
	{key:"TotalEnergy", label:"TotalEnergy", sortable:true},<br />
	{key:"MaxPeak", label:"MaxPeak", sortable:true},<br />
	{key:"NumbOfStrokes", label:"NumbOfStrokes", sortable:true},<br />
        {key:"jpgID", label:"jpgID", sortable:true}<br />
    ];</p>
<p>    // Custom parser<br />
    var stringToDate = function(sData) {<br />
        var array = sData.split(&#8220;-&#8221;);<br />
        return new Date(array[1] + &#8221; &#8221; + array[0] + &#8220;, &#8221; + array[2]);<br />
    };</p>
<p>    // DataSource instance<br />
    var myDataSource = new YAHOO.util.DataSource(&#8220;json_proxy.php?&#8221;);<br />
    myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;<br />
    myDataSource.responseSchema = {<br />
        resultsList: &#8220;records&#8221;,<br />
        fields: [<br />
		{key:"ID", parser:"number"},<br />
		{key:"Date"},<br />
		{key:"Time" /*parser:stringToDate*/ },<br />
		{key:"TotalCharge",parser:"number"},<br />
		{key:"TotalEnergy",parser:"number"},<br />
		{key:"MaxPeak",parser:"number"},<br />
		{key:"NumbOfStrokes",parser:"number"},<br />
		{key:"jpgID"}<br />
        ],<br />
        metaFields: {<br />
            totalRecords: &#8220;totalRecords&#8221; // Access to value in the server response<br />
        }<br />
    };</p>
<p>    // DataTable configuration<br />
    var myConfigs = {<br />
        initialRequest: &#8220;sort=ID&amp;dir=asc&amp;startIndex=0&amp;results=25&#8243;, // Initial request for first page of data<br />
        dynamicData: true, // Enables dynamic server-driven data<br />
        sortedBy : {key:&#8221;ID&#8221;, dir:YAHOO.widget.DataTable.CLASS_ASC}, // Sets UI initial sort arrow<br />
        paginator: new YAHOO.widget.Paginator({ rowsPerPage:25 }) // Enables pagination<br />
    };</p>
<p>    // DataTable instance<br />
    var myDataTable = new YAHOO.widget.DataTable(&#8220;dynamicdata&#8221;, myColumnDefs, myDataSource, myConfigs);<br />
    // Update totalRecords on the fly with value from server<br />
    myDataTable.handleDataReturnPayload = function(oRequest, oResponse, oPayload) {<br />
        oPayload.totalRecords = oResponse.meta.totalRecords;<br />
        return oPayload;<br />
    }</p>
<p>    return {<br />
        ds: myDataSource,<br />
        dt: myDataTable<br />
    };</p>
<p>}();</p>
<p>Please anyone explain what and where I must put a code for refreshings? Thank&#8217;s.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach Leatherman</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-956</link>
		<dc:creator>Zach Leatherman</dc:creator>
		<pubDate>Sun, 08 Mar 2009 15:43:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-956</guid>
		<description>Hey guys, these types of technical support questions should be posted on the YUI mailing list.  You&#039;ll get the best response over there.

&lt;a href=&quot;http://tech.groups.yahoo.com/group/ydn-javascript/&quot; rel=&quot;nofollow&quot;&gt;http://tech.groups.yahoo.com/group/ydn-javascript/&lt;/a&gt;

Thanks,
Zach</description>
		<content:encoded><![CDATA[<p>Hey guys, these types of technical support questions should be posted on the YUI mailing list.  You&#8217;ll get the best response over there.</p>
<p><a href="http://tech.groups.yahoo.com/group/ydn-javascript/" rel="nofollow">http://tech.groups.yahoo.com/group/ydn-javascript/</a></p>
<p>Thanks,<br />
Zach</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhishek</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-955</link>
		<dc:creator>Abhishek</dc:creator>
		<pubDate>Sun, 08 Mar 2009 07:37:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-955</guid>
		<description>Hi , 
I am using t:datatable , my requirment is i need to show remove link in the last column but last column need not to have header in that but first two col should have header , when i am using facet in any of the column jsf automatically crated th for each coumn. Cna you help ? i used to headerStyleClass which is associated with t:column still no luck. Can i override column header class ??</description>
		<content:encoded><![CDATA[<p>Hi ,<br />
I am using t:datatable , my requirment is i need to show remove link in the last column but last column need not to have header in that but first two col should have header , when i am using facet in any of the column jsf automatically crated th for each coumn. Cna you help ? i used to headerStyleClass which is associated with t:column still no luck. Can i override column header class ??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Datatable sort on one column only</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-951</link>
		<dc:creator>Datatable sort on one column only</dc:creator>
		<pubDate>Wed, 25 Feb 2009 16:55:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-951</guid>
		<description>Hi, I have problem to enable sorting on more than one column (the last column defined in myColumnDef) in YUI datatable. Could anybody find out the error in my code?

Here is my code:
                   
                    YAHOO.util.Event.addListener(window, &quot;load&quot;, function() {
                        YAHOO.example.MultipleFeatures = function() {
                        var i=0;
                        var data = new Array();
                        
                          data[i++] =
                            {title: &quot;&quot;,
                             lastChangedBy:&quot;&quot;
                             };
                        
                         var myColumnDefs = [
                                  {key:&quot;lastChangedBy&quot;, label: &quot;Updated Person&quot;,sortable:true, resizeable:true},
                                  {key:&quot;title&quot;, label: &quot;Asset Group Name&quot;, sortable:true, resizeable:true}
                                ];

                        /* This is where we set up the DataTable */
                        var myDataSource = new YAHOO.util.DataSource(data);
                        myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
                        myDataSource.responseSchema = {
                        fields: [{key:&quot;lastChangedBy&quot;},{key:&quot;title&quot;}  ]};
                        // Here is where we configure the pagination of the table. If the users want this, just flip flag to true
                        var myConfigs = {
                             paginator : new YAHOO.widget.Paginator({
                                 rowsPerPage    : 10
                             })
                         };


                        var myDataTable = new YAHOO.widget.DataTable(&quot;basic&quot;,
                                myColumnDefs, myDataSource, myConfigs);

                        return {
                            oDS: myDataSource,
                            oDT: myDataTable
                        };
                    }();
                  });
                  </description>
		<content:encoded><![CDATA[<p>Hi, I have problem to enable sorting on more than one column (the last column defined in myColumnDef) in YUI datatable. Could anybody find out the error in my code?</p>
<p>Here is my code:</p>
<p>                    YAHOO.util.Event.addListener(window, &#8220;load&#8221;, function() {<br />
                        YAHOO.example.MultipleFeatures = function() {<br />
                        var i=0;<br />
                        var data = new Array();</p>
<p>                          data[i++] =<br />
                            {title: &#8220;&#8221;,<br />
                             lastChangedBy:&#8221;"<br />
                             };</p>
<p>                         var myColumnDefs = [<br />
                                  {key:"lastChangedBy", label: "Updated Person",sortable:true, resizeable:true},<br />
                                  {key:"title", label: "Asset Group Name", sortable:true, resizeable:true}<br />
                                ];</p>
<p>                        /* This is where we set up the DataTable */<br />
                        var myDataSource = new YAHOO.util.DataSource(data);<br />
                        myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;<br />
                        myDataSource.responseSchema = {<br />
                        fields: [{key:"lastChangedBy"},{key:"title"}  ]};<br />
                        // Here is where we configure the pagination of the table. If the users want this, just flip flag to true<br />
                        var myConfigs = {<br />
                             paginator : new YAHOO.widget.Paginator({<br />
                                 rowsPerPage    : 10<br />
                             })<br />
                         };</p>
<p>                        var myDataTable = new YAHOO.widget.DataTable(&#8220;basic&#8221;,<br />
                                myColumnDefs, myDataSource, myConfigs);</p>
<p>                        return {<br />
                            oDS: myDataSource,<br />
                            oDT: myDataTable<br />
                        };<br />
                    }();<br />
                  });</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach Leatherman</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-853</link>
		<dc:creator>Zach Leatherman</dc:creator>
		<pubDate>Tue, 09 Sep 2008 19:20:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-853</guid>
		<description>Hey sirjon and Khushbu,
You&#039;re much better off trying the YUI mailing list located here: http://tech.groups.yahoo.com/group/ydn-javascript/

Thanks!
Zach</description>
		<content:encoded><![CDATA[<p>Hey sirjon and Khushbu,<br />
You&#8217;re much better off trying the YUI mailing list located here: <a href="http://tech.groups.yahoo.com/group/ydn-javascript/" rel="nofollow">http://tech.groups.yahoo.com/group/ydn-javascript/</a></p>
<p>Thanks!<br />
Zach</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Khushbu</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-852</link>
		<dc:creator>Khushbu</dc:creator>
		<pubDate>Tue, 09 Sep 2008 19:18:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-852</guid>
		<description>How do I display data dynamically into my datatable using type_json or type_xml? I can not find any good example.</description>
		<content:encoded><![CDATA[<p>How do I display data dynamically into my datatable using type_json or type_xml? I can not find any good example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sirjon</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-767</link>
		<dc:creator>sirjon</dc:creator>
		<pubDate>Wed, 07 May 2008 06:59:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-767</guid>
		<description>Hi ,I want to add the drop-down in the YUI panel header.
Please help as I am completeley stuck on this.</description>
		<content:encoded><![CDATA[<p>Hi ,I want to add the drop-down in the YUI panel header.<br />
Please help as I am completeley stuck on this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach Leatherman</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-412</link>
		<dc:creator>Zach Leatherman</dc:creator>
		<pubDate>Sun, 07 Oct 2007 13:05:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-412</guid>
		<description>Sounds like you need to head over to the bug tracker:

http://sourceforge.net/tracker/?group_id=165715&amp;atid=836476</description>
		<content:encoded><![CDATA[<p>Sounds like you need to head over to the bug tracker:</p>
<p><a href="http://sourceforge.net/tracker/?group_id=165715&#038;atid=836476" rel="nofollow">http://sourceforge.net/tracker/?group_id=165715&#038;atid=836476</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shafique</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-409</link>
		<dc:creator>Shafique</dc:creator>
		<pubDate>Tue, 02 Oct 2007 15:18:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-409</guid>
		<description>I&#039;ve noticed that when implementing a custom sort method, and setting &quot;sortable: true&quot; on the columns I wanted sortable, and explicitly setting &quot;sortable: false&quot; on the columns that CANNOT be sorted, i am allowed to click ANY column head and the table will refresh! Those columns with sortable: true make a nice hand-pointer and a tooltip, while those with sortable: false are a non-clickable arrow (which is in fact clickable). Is this bug being addressed?</description>
		<content:encoded><![CDATA[<p>I&#8217;ve noticed that when implementing a custom sort method, and setting &#8220;sortable: true&#8221; on the columns I wanted sortable, and explicitly setting &#8220;sortable: false&#8221; on the columns that CANNOT be sorted, i am allowed to click ANY column head and the table will refresh! Those columns with sortable: true make a nice hand-pointer and a tooltip, while those with sortable: false are a non-clickable arrow (which is in fact clickable). Is this bug being addressed?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach Leatherman</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-333</link>
		<dc:creator>Zach Leatherman</dc:creator>
		<pubDate>Wed, 25 Jul 2007 23:46:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-333</guid>
		<description>Hey Pankaj, that sounds like a better question for the YUI Developer Mailing List.

http://tech.groups.yahoo.com/group/ydn-javascript/

Sounds like your use case is possible.  Have you looked at the examples describing XHR for the DataTable?

http://developer.yahoo.com/yui/datatable/#xhr</description>
		<content:encoded><![CDATA[<p>Hey Pankaj, that sounds like a better question for the YUI Developer Mailing List.</p>
<p><a href="http://tech.groups.yahoo.com/group/ydn-javascript/" rel="nofollow">http://tech.groups.yahoo.com/group/ydn-javascript/</a></p>
<p>Sounds like your use case is possible.  Have you looked at the examples describing XHR for the DataTable?</p>
<p><a href="http://developer.yahoo.com/yui/datatable/#xhr" rel="nofollow">http://developer.yahoo.com/yui/datatable/#xhr</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pankaj</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-326</link>
		<dc:creator>Pankaj</dc:creator>
		<pubDate>Tue, 24 Jul 2007 12:22:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-326</guid>
		<description>Hi,
can you please provide me an example, in which paging is implemented and on every click the data comes from the database rather than just a simple data.js file</description>
		<content:encoded><![CDATA[<p>Hi,<br />
can you please provide me an example, in which paging is implemented and on every click the data comes from the database rather than just a simple data.js file</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Howey</title>
		<link>http://www.zachleat.com/web/problems-with-yui-datatable/comment-page-1/#comment-289</link>
		<dc:creator>Matt Howey</dc:creator>
		<pubDate>Thu, 12 Jul 2007 12:38:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/04/problems-with-yui-datatable/#comment-289</guid>
		<description>Tamilselvan: regarding your &quot;each table row has a edit button&quot; - I&#039;m sure by now you&#039;ve figured out how to do this, but I thought I would offer a solution that I find to work well. Setup row highlighting, put a subscription to the click event and a keylistener for the [enter] key, then perhaps you could edit in a YUI panel or something. As long as you are listening for a doubleclick and enter, you&#039;ll be able to implement this. Then when done editing, close the panel and return focus to the datatable....</description>
		<content:encoded><![CDATA[<p>Tamilselvan: regarding your &#8220;each table row has a edit button&#8221; &#8211; I&#8217;m sure by now you&#8217;ve figured out how to do this, but I thought I would offer a solution that I find to work well. Setup row highlighting, put a subscription to the click event and a keylistener for the [enter] key, then perhaps you could edit in a YUI panel or something. As long as you are listening for a doubleclick and enter, you&#8217;ll be able to implement this. Then when done editing, close the panel and return focus to the datatable&#8230;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

