<?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: YUI: Refresh DataTable &#8211; Method 2</title>
	<atom:link href="http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/</link>
	<description>The Tao of Ruby, Python, and....Straw Dogs?</description>
	<lastBuildDate>Wed, 11 Jan 2012 07:10:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Edward</title>
		<link>http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/comment-page-1/#comment-2112</link>
		<dc:creator>Edward</dc:creator>
		<pubDate>Mon, 15 Feb 2010 09:34:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/#comment-2112</guid>
		<description>By the way, I have took into acount that when I enabled/disabled in DataTable-configurations option &quot;dynamic server-driven data&quot; in FireFox you filled this changings straight away but in IE it doesn&#039;t work! This option perfect work with FireFox but how I can force work it in IE? Please help any one, becouse I am facing with this problem during a half of year and couldn&#039;t solved it yet. Thank&#039;s for any help.</description>
		<content:encoded><![CDATA[<p>By the way, I have took into acount that when I enabled/disabled in DataTable-configurations option &#8220;dynamic server-driven data&#8221; in FireFox you filled this changings straight away but in IE it doesn&#8217;t work! This option perfect work with FireFox but how I can force work it in IE? Please help any one, becouse I am facing with this problem during a half of year and couldn&#8217;t solved it yet. Thank&#8217;s for any help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Edward</title>
		<link>http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/comment-page-1/#comment-2109</link>
		<dc:creator>Edward</dc:creator>
		<pubDate>Sun, 14 Feb 2010 20:17:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/#comment-2109</guid>
		<description>Hallo again. I&#039;ve tried your method, thank&#039;s, however it doesn&#039;t work. In case when i test the code in FireFox - i work correct. With IE - no chance. Only in one case it works correct in IE - when I click sorting by mouse in column. Could any one clarify me how i can manually call function responsible for this sorting in the table?</description>
		<content:encoded><![CDATA[<p>Hallo again. I&#8217;ve tried your method, thank&#8217;s, however it doesn&#8217;t work. In case when i test the code in FireFox &#8211; i work correct. With IE &#8211; no chance. Only in one case it works correct in IE &#8211; when I click sorting by mouse in column. Could any one clarify me how i can manually call function responsible for this sorting in the table?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Saidi</title>
		<link>http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/comment-page-1/#comment-1677</link>
		<dc:creator>Saidi</dc:creator>
		<pubDate>Mon, 17 Aug 2009 02:32:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/#comment-1677</guid>
		<description>Hello Edward:
Please try it like 
function refreshGrid(gridObj){
        gridObj.initializeTable();
	gridObj.doBeforePaginatorChange();
	var dpage = gridObj.get(&#039;paginator&#039;);	
   dpage.fireEvent(&#039;changeRequest&#039;,dpage.getState({&#039;page&#039;:1}));
}
gridObj:your grid instance.</description>
		<content:encoded><![CDATA[<p>Hello Edward:<br />
Please try it like<br />
function refreshGrid(gridObj){<br />
        gridObj.initializeTable();<br />
	gridObj.doBeforePaginatorChange();<br />
	var dpage = gridObj.get(&#8216;paginator&#8217;);<br />
   dpage.fireEvent(&#8216;changeRequest&#8217;,dpage.getState({&#8216;page&#8217;:1}));<br />
}<br />
gridObj:your grid instance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Edward</title>
		<link>http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/comment-page-1/#comment-1429</link>
		<dc:creator>Edward</dc:creator>
		<pubDate>Mon, 27 Jul 2009 11:04:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/#comment-1429</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: Saidi</title>
		<link>http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/comment-page-1/#comment-1123</link>
		<dc:creator>Saidi</dc:creator>
		<pubDate>Thu, 25 Jun 2009 05:59:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/#comment-1123</guid>
		<description>var callback = {
				success:myDataTable.onDataReturnInitializeTable,
				failure:myDataTable.onDataReturnInitializeTable,
				argument : myDataTable.getState(),
				scope:myDataTable
			};
			myDataTable.doBeforePaginatorChange();
			myDataTable.getDataSource().sendRequest(myReqBuilder(myDataTable.getState(),false),callback);

note:&#039;myReqBuilder&#039; is a function.It return the string like &quot;startIndex=0&amp;results=20&amp;staffNoOrName=aa&quot;</description>
		<content:encoded><![CDATA[<p>var callback = {<br />
				success:myDataTable.onDataReturnInitializeTable,<br />
				failure:myDataTable.onDataReturnInitializeTable,<br />
				argument : myDataTable.getState(),<br />
				scope:myDataTable<br />
			};<br />
			myDataTable.doBeforePaginatorChange();<br />
			myDataTable.getDataSource().sendRequest(myReqBuilder(myDataTable.getState(),false),callback);</p>
<p>note:&#8217;myReqBuilder&#8217; is a function.It return the string like &#8220;startIndex=0&amp;results=20&amp;staffNoOrName=aa&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fp</title>
		<link>http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/comment-page-1/#comment-1121</link>
		<dc:creator>fp</dc:creator>
		<pubDate>Fri, 19 Jun 2009 14:52:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/#comment-1121</guid>
		<description>Use render. refreshView seems obsolete.</description>
		<content:encoded><![CDATA[<p>Use render. refreshView seems obsolete.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: imran</title>
		<link>http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/comment-page-1/#comment-1119</link>
		<dc:creator>imran</dc:creator>
		<pubDate>Wed, 17 Jun 2009 00:27:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/#comment-1119</guid>
		<description>Hi John Aguinaldo,

By refresh u mean auto refresh or on reload (f5 key) ?

how to refresh table without page refresh?

any function in YUI for auto-refresh after some interval..!!

i don want to use timer in js.</description>
		<content:encoded><![CDATA[<p>Hi John Aguinaldo,</p>
<p>By refresh u mean auto refresh or on reload (f5 key) ?</p>
<p>how to refresh table without page refresh?</p>
<p>any function in YUI for auto-refresh after some interval..!!</p>
<p>i don want to use timer in js.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Aguinaldo</title>
		<link>http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/comment-page-1/#comment-1055</link>
		<dc:creator>John Aguinaldo</dc:creator>
		<pubDate>Sat, 18 Apr 2009 16:06:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/#comment-1055</guid>
		<description>In YUI 2.7.0 I had to use the following:


    myDataTable.getRecordSet().replaceRecords(newData)
    myDataTable.refreshView()
</description>
		<content:encoded><![CDATA[<p>In YUI 2.7.0 I had to use the following:</p>
<p>    myDataTable.getRecordSet().replaceRecords(newData)<br />
    myDataTable.refreshView()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Data Shaman</title>
		<link>http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/comment-page-1/#comment-818</link>
		<dc:creator>Data Shaman</dc:creator>
		<pubDate>Wed, 17 Dec 2008 16:22:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/#comment-818</guid>
		<description>Formatting broken...

datatable.getDataSource().sendRequest(
   datatable._request,
   datatable.onDataReturnInitializeTable,
   datatable
);</description>
		<content:encoded><![CDATA[<p>Formatting broken&#8230;</p>
<p>datatable.getDataSource().sendRequest(<br />
   datatable._request,<br />
   datatable.onDataReturnInitializeTable,<br />
   datatable<br />
);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Data Shaman</title>
		<link>http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/comment-page-1/#comment-817</link>
		<dc:creator>Data Shaman</dc:creator>
		<pubDate>Wed, 17 Dec 2008 16:21:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.straw-dogs.co.uk/03/01/yui-refresh-datatable-method-2/#comment-817</guid>
		<description>This works for me with a datasource. I store the request in a property called _request when the datatable is created and the first request goes out.

datatable.getDataSource().sendRequest(datatable._request, datatable.onDataReturnInitializeTable, datatable);</description>
		<content:encoded><![CDATA[<p>This works for me with a datasource. I store the request in a property called _request when the datatable is created and the first request goes out.</p>
<p>datatable.getDataSource().sendRequest(datatable._request, datatable.onDataReturnInitializeTable, datatable);</p>
]]></content:encoded>
	</item>
</channel>
</rss>

