I hadn't realized that "arrayForEach" was already added to the Array
object, so the line:
     test.forEach(log,test);
works in place of :
     test.arrayForEach = qx.lang.Core.arrayForEach;
     test.arrayForEach(log,test);

-deech

On Sat, Dec 4, 2010 at 2:13 PM, aditya siram <[email protected]> wrote:
> You can use the qx.lang.Object.getValues(obj) function to turn the
> values in a map into an array. Eg.
>
>      var test = [{col1:"a",col2:"aa",col3:"aaa"},
>                  {col1:"b",col2:"bb",col3:"bbb"},
>                  {col1:"c",col2:"cc",col3:"ccc"}];
>      var log = function (obj) {
>        console.log(qx.lang.Object.getValues(obj));
>      };
>
>      test.arrayForEach = qx.lang.Core.arrayForEach;
>      test.arrayForEach(log,test);
>
> =>  ["a", "aa", "aaa"] ["b", "bb", "bbb"] ["c", "cc", "ccc"]
>
> Does this help?
> -deech
>
> On Sat, Dec 4, 2010 at 1:16 PM, Marco Pompili <[email protected]> wrote:
>>
>> Hi qooxdoers,
>>
>> I'm retreiving data in json format and i want to put that data in a Simple()
>> data model with the method:
>>
>> var jsonData = response.getContent();
>> setData( jsonData );
>>
>> The problem is that the Json data is an array of object and so the method
>> doesn't work.
>>
>> I would like to add directly json data into the table without doing this:
>>
>> var rows = new qx.data.Array();
>>
>> for ( var i = 0; i < jsonData.length; i++ ) {
>>
>>  var row = [
>>    jsonData[i].col1,
>>    jsonData[i].col2,
>>    jsonData[i].col3
>>  ];
>>
>>  rows.push( row );
>> }
>>
>> mytablemodel.setData( rows );
>>
>> I would like to avoid to select the data manualli for every object, because
>> Json is an array of objects from what i've learned:
>>
>> [[object],[object],[object],[object]]
>>
>> I would like to convert the json data structure in arrays:
>>
>> [[array],[array],[array],[array]]
>>
>> so i can use it directly to set data in my table data model.
>>
>> I guess it's possible i'm just too ignorant to know how i can be done...
>>
>> Thank you all, expecially to everyone will be so kind to responde me.
>>
>> Bye!
>> --
>> View this message in context: 
>> http://qooxdoo.678.n2.nabble.com/Json-and-Table-models-tp5803644p5803644.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
>>
>

------------------------------------------------------------------------------
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