Sorry,
Now I've used the source version and this is the uncompressed error message:

this.__rowArr[rowIndex] is undefined
return this.__rowArr[rowIndex][columnIndex];

from qx.ui.table.model.Simple() line(439):
// overridden
433 getValue : function(columnIndex, rowIndex)
434 {
435 if (rowIndex < 0 || rowIndex >= this.__rowArr.length) {
436 throw new Error("this.__rowArr out of bounds: " + rowIndex + " (0.." +
this.__rowArr.length + ")");
437 }
438
439 return this.__rowArr[rowIndex][columnIndex]; <----
440 },

i've made a class for storing json data into a simple table model:

qx.Class.define("eco_admin.table.model.JsonSimpleModel", {
        
        extend : qx.ui.table.model.Simple,
        
        members:
        {
                setEmpty: function() {
                        this.setData( null );
                },
                
                //Get Json data for the Categorie and Product tables
                getData: function(mode) {
                        
                        var req = new
qx.io.remote.Request("http://localhost/~loki/eco_admin/services/getTableRowData.php";,
"POST", "application/json");
                        req.setParameter('mode', mode);
                        req.addListener('completed', this._onGetDataCompleted, 
this);
                        req.send();
                },
                
                //Fires on table data read completely
                _onGetDataCompleted: function(response) {
                        
                        var jsonRows = response.getContent();
                        //var rows = new qx.data.Array();
                        var rows = new Array();
                        
                        var addRow = function (obj) {
                                //console.log(qx.lang.Object.getValues(obj));
                                rows.push(qx.lang.Object.getValues(obj));
                        };
                        
                        jsonRows.forEach = qx.lang.Core.arrayForEach;
                        jsonRows.forEach( addRow, jsonRows );
                        //jsonRows.forEach( addRow, jsonRows );
                        
                        this.setData( rows );
                }
        }
});


If i use the qx.data.Array() wrapper i get the error above:

this.__rowArr[rowIndex] is undefined
return this.__rowArr[rowIndex][columnIndex];

I'm missing something. I guess i'm missing a row ?

As Derrel is saying i want to get much browser indipendence as possible.
Using the qx.lang.Core.arrayForEach class should help with that as I
understand.

The code works perfectly, so thank you both for your help, that's just this
thing with the qx.data.Array() class that makes me curious about what is the
problem.
-- 
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Json-and-Table-models-tp5803644p5805169.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to