On Thu, Oct 28, 2010 at 08:04, Qoodary <[email protected]> wrote:
>
> Hi Derrel,
> thanks a lot for your help.
>
>
> >Firstly, you do actually need to do as it says. You are being asked only
> for
> >a subset of the rows, not all of the rows, and you should return only the
> >rows that were requested.
>
> hmm, I don not understand this. In my example the "status.php" receives 90
> rows back from a database. I want to show all these 90 rows in the table.
> Why do I need a "firstrow" and "lastrow"?
>
Because it won't always ask for all rows. If you have 1,000,000 rows in your
table at the backend, you wouldn't want the table to request that all
million of them be sent, right? The table will request the ones it wants to
display immediately, along with some buffer's worth (extras nearby) to make
scrolling immediate.
> >The format of the returned data is defined. I suspect that your server is
> >returning data in a format other than what is expected. Look at the
> >documentation or the implementation of _onRowDataLoaded() to see exactly
> >what format is required. Then use Firebug or equivalent to look at the
> data
> >to ensure you're matching that format.
>
> In the apiviewer I can find this for _onRowDataLoaded()
>
> _onRowDataLoaded(Map[] rowDataArr)
>
> Sets row data.
>
> Has to be called by #_loadRowData.
> Parameters:
> rowDataArr
>
> the loaded row data or null if there was an error.
> Access:
> protected
>
> I assume this must be an array same as for the simple table model? I
> receive
> the table data in an array.
>
If you look at the demobrowser, there's a "Table Remote_Model" demo. It
doesn't actually go out to a remote server, but it simulates it. Here's the
data model it uses, with some extra comments. This should get you going in
the right direction...
qx.Class.define('demobrowser.demo.table.RemoteTableModel', {
extend : qx.ui.table.model.Remote,
construct : function() {
this.base(arguments);
// This is specifying both the column heading text (the 1st array), and
the column ids (2nd array)
this.setColumns(["Id","Text"],["id","text"]);
},
members : {
// overloaded - called whenever the table requests the row count
_loadRowCount : function()
{
this._onRowCountLoaded(1000000);
},
_loadRowData : function(firstRow, lastRow)
{
var data = [];
// Send the data for all of the reqested rows. Each row of data is a
map with keys
// equal to each of the column ids, and values for the data to
correspond to that
// column on that row.
for (var i=firstRow;i<=lastRow;i++){
data.push({id:i,text:'Hello '+i+' Generated on:'+(new Date())});
}
this._onRowDataLoaded(data);
}
}
});
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel