Hello together,
how is it possible to set a complete Column Model via RemoteTableModel,
including visibility, sort ability and width of each column?
I've tried to call a function while _loadRowCount but then the result is
empty: no error, no table model.
Any Ideas?
Thank You,
Christian Bieser
My "custom.remoteTableModel.js":
-----
qx.OO.defineClass("custom.remoteTableModel", qx.ui.table.RemoteTableModel,
function ()
{
qx.ui.table.RemoteTableModel.call( this );
this._url = "" ;
});
qx.Proto.setUrl = function( url )
{
this._url = url ;
};
qx.Proto.setPtype = function( ptype )
{
this._ptype = ptype ;
};
qx.Proto.getPtype = function( )
{
return this._ptype;
};
qx.Proto._loadRowCount = function()
{
var req = new qx.io.remote.Request(this._url + "count/",
"GET",
"text/plain"
);
req.addEventListener( "completed", function( e ) {
var content = e.getData().getContent();
var data = qx.io.Json.parseQx( content );
this.debug( data['count'] + " in remote result set" );
// here i've tried to set the column model through calling a function named
»_loadColumnModel( data['columns'] );«
this._onRowCountLoaded( data['count'] );
}, this) ;
req.setParameter("ptype", this._ptype );
req.send();
};
qx.Proto._loadRowData = function(firstRow, lastRow)
{
var limitFrom = firstRow;
var limitRows = ( lastRow - firstRow ) + 1;
//this.debug("call to _loadRowData(" + firstRow + "," + lastRow + ") =>
SQL limit( " + limitFrom + ", " + limitRows + " )");
var req = new qx.io.remote.Request( this._url + "remoteTableData/",
"GET",
"text/plain"
);
req.addEventListener("completed", function(e) {
//this.debug( "loaded rows "+firstRow+" to "+lastRow);
//this.debug( "sort by ColumnId: "+this.getColumnId(
this._sortColumnIndex
) );
//this.debug( "sort ASC?: "+this._sortAscending );
var content = e.getData().getContent() ;
var data = qx.io.Json.parseQx(content);
this._onRowDataLoaded( data );
}, this);
// Type
req.setParameter("ptype", this._ptype );
// Limit
req.setParameter("from", limitFrom );
req.setParameter("to", limitRows );
// Sort by
if ( -1 != this._sortColumnIndex )
{
req.setParameter( "orderby", this.getColumnId(
this._sortColumnIndex ) );
req.setParameter( "orderASC", this._sortAscending );
} // if)
req.send();
};
--
View this message in context:
http://www.nabble.com/Remote-Columns-in-RemoteTableModel--%28v0.6.6%29-tf3865523.html#a10950803
Sent from the qooxdoo-devel mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel