[qooxdoo-devel] More RemoteTableModel
Brought to you by:
ecker,
martinwittemann
From: Bryan W. <br...@ab...> - 2006-12-06 21:34:47
|
I'm still working on this but at the moment and i'm coming up to speed on ajax and qooxdoo so i'm not sure whether i'm dealing with a bug in my code or whether i'm there is a bug in my code. The problem is that while the table model loads just fine, the table itself doesn't display. Before, I was using SimpleTableModel and the table displayed just fine. Currently, the debug log shows two blocks loaded from the remote table and the table status bar shows 3078 rows (which is correct) but none of the rows themselves actually show up. If I set the loads to be synchronous then the system fails from stack overload...besides, for this i want it to be asynchronous. I need to have the table loading smoothly but in an asynch manner since there can be a large amount of data...(note that this is not a stock app...thats just the test data i'm using to work out the details). Any help or suggestions would be appreciated. Thanks -bryanw The address to look at the app is http://www.abwaters.com/ajax/data1/ and the data is accessible at http://www.abwaters.com/ajax/rest/data/dbjson.php //**************************** debug log 000844 DEBUG: qx.core.Init[3]: qooxdoo 0.6.3 (r5000) 000859 DEBUG: qx.core.Init[3]: loaded 280 classes 000875 DEBUG: qx.core.Init[3]: client: mshtml-7.0/win/en 000875 INFO: qx.component.init.InterfaceInitComponent[28]: initialize runtime: 0ms 000937 DEBUG: qx.ui.table.TablePane[163]: USE_ARRAY_JOIN:false, USE_TABLE:false 000984 INFO: qx.component.init.InterfaceInitComponent[28]: main runtime: 94ms 001000 DEBUG: qx.component.init.InterfaceInitComponent[28]: preloading visible images... 001062 DEBUG: abwaters.data.TestTableModel2[80]: 3078 in remote result set 001062 DEBUG: abwaters.data.TestTableModel2[80]: loaded columns: market_date,open,high,low,close,volume,adj_close 001078 DEBUG: abwaters.data.TestTableModel2[80]: row count loaded: 3078 001140 DEBUG: qx.component.init.InterfaceInitComponent[28]: preloading complete 001234 DEBUG: abwaters.data.TestTableModel2[80]: Starting server request. rows: 0..-1, blocks: 0..1 001250 DEBUG: abwaters.data.TestTableModel2[80]: call to _loadRowData(0,99) 001281 DEBUG: abwaters.data.TestTableModel2[80]: 3078 in remote result set 001281 DEBUG: abwaters.data.TestTableModel2[80]: loaded columns: market_date,open,high,low,close,volume,adj_close 001297 DEBUG: abwaters.data.TestTableModel2[80]: row count loaded: 3078 001344 INFO: qx.component.init.InterfaceInitComponent[28]: finalize runtime: 204ms 001515 DEBUG: abwaters.data.TestTableModel2[80]: loaded rows 0 to 99 001531 DEBUG: abwaters.data.TestTableModel2[80]: Got server answer. blocks: 0..1. mail count: 100 block count:2 //**************************** table mode code qx.OO.defineClass("abwaters.data.TestTableModel2", qx.ui.table.RemoteTableModel, function () { qx.ui.table.RemoteTableModel.call(this); this._url = "" ; }); qx.Proto.setUrl = function(url) { this._url = url ; } qx.Proto._loadColumns = function(fieldsArr) { cols = new Array(fieldsArr.length) ; for (var i = 0; i < fieldsArr.length; ++i) { cols[i] = fieldsArr[i].name ; } this.debug("loaded columns: "+cols); this.setColumns(cols) ; } qx.Proto._loadRowCount = function() { var req = new qx.io.remote.Request(this._url+"?src=1&sf=1", "GET","text/plain"); req.addEventListener("completed", function(e) { var content = e.getData().getContent(); var data = qx.io.Json.parseQx(content); this.debug(""+data.numrows+" in remote result set"); this._loadColumns(data.fields) ; this._onRowCountLoaded(data.numrows); }, this) ; req.send(); }; qx.Proto._loadRowData = function(firstRow, lastRow) { this.debug("call to _loadRowData(" + firstRow + "," + lastRow + ")"); var rc = (lastRow-firstRow)+1 ; var req = new qx.io.remote.Request("/ajax/rest/data/dbjson.php?sr="+firstRow+"&rc="+rc,"GET", "text/plain"); req.addEventListener("completed", function(e) { this.debug("loaded rows "+firstRow+" to "+lastRow); var content = e.getData().getContent() ; var data = qx.io.Json.parseQx(content); this._onRowDataLoaded(data.rows); }, this); req.send(); }; |