Doing like this
model.push(qx.data.marshal.Json.createModel({label: "Another new item"}))
and one another item to be added =)
Items in qx.data.Array() are qooxdoo objects. The createModel constructs
class and creates an instance (every property get/set accessors and event).
So, model.getItem(N) will return qooxdoo object with label property.
On 26 March 2012 12:37, Alexei Vinidiktov <[email protected]>wrote:
> Thanks, Ivan, that worked.
>
> How do I add an item to the end of the model or insert one?
>
> Neither of these seems to work:
>
> model.push({label: "New item"});
> model.insertAt(10, {label: "New item"});
>
> Removing an item works, by the way:
> model.removeAt(10);
>
>
>
> On Mon, Mar 26, 2012 at 6:32 AM, Ivan Pogorelov
> <[email protected]>wrote:
>
>> Hi,
>>
>> The model is qx.data.Array() instance (in this case), so
>>
>> model.getItem(19).set({label : 'Another 19th'});
>>
>> will set label's value.
>>
>> TBRDs,
>> Ivan
>>
>> On 25 March 2012 19:21, Alexei Vinidiktov <[email protected]>wrote:
>>
>>> Hello,
>>>
>>> I'm learning how to use a virtual list.
>>>
>>> I'm trying to figure out how to modify a property (in this case it's a
>>> label) of a model's item but I keep getting this error:
>>>
>>> 022713 Error in the 'Widget' queue:Binding property label of object
>>> [object Object] not possible: No event available. : error
>>>
>>> Here's a link to my code in the playground:
>>> *http://tinyurl.com/6wwzwnr*
>>>
>>> //create the model data
>>> var rawData = [];
>>> for (var i = 0; i < 50; i++) {
>>> rawData[i] = {
>>> label: "Item No " + i
>>> };
>>> }
>>> var model = qx.data.marshal.Json.createModel(rawData);
>>>
>>> //create the list
>>> var list = new qx.ui.list.List(model).set({
>>> labelPath: "label"});
>>>
>>> // Here I'm trying to modify the property "label" of an item
>>> // but it doesn't work
>>> model.setItem(19, {label : "New content"});
>>>
>>> --
>>> Alexei
>>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> This SF email is sponsosred by:
>> Try Windows Azure free for 90 days Click Here
>> http://p.sf.net/sfu/sfd2d-msazure
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>
>
>
> --
> Alexei Vinidiktov
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel