-
30 Jun 2010 3:15 AM #1
add new items to nestedlist
add new items to nestedlist
hey sencha community

i am new in this board and i need a little bit help as first.
i create a little application with the new sencha framework and i have problems with the nestedlist, i cant add new items:
we have test it with add, render, doLayout etc.Code:for(i=0;i<responseObj.lists.length;i++){ var rowData = responseObj.lists[i]; var newItem = nestedList.add({text:rowData.name}); nestedList.doLayout(); }
what i do wrong? thanks for help and sorry for my bad english
-
30 Jun 2010 5:07 AM #2
Give something like this a go
once you have created your object you then have to create a nestedlist objectPHP Code:var newObject = Array();
for (var i = 0; i < responseObj.length; i++) {
newObject.push(
{
name : responseObj[i]['col1'],
id:responseObj[i]['col2'],
label: responseObj[i]['col3'],
value: responseObj[i]['col4'],
listeners: onChangeValue
}
);
}
----------------------------------------------------------------------------------------
var newItem = {
title: title,
items: [newObject]
}
And then set the list.PHP Code:var nestedList = new Ext.NestedList({
fullscreen: true,
items: []
});
PHP Code:nestedList.setList(newItem, true);
-
30 Jun 2010 5:46 AM #3
-
7 Sep 2010 1:19 PM #4
is this an undocumented method? Also, is this meant to add multiple items at one time? I have only been able to add a single item and it replaces the list that is currently there. I've been trying to update the list by doing the following
but the interface does not repaint the new items. Can anybody help me out with this?Code:var newItem = { baseCls: 'order-blotter-item', html: '<div class="order-blotter-item-content"><div id="sell_arrow"></div><div class="order-blotter-item-side">Sell</div><div class="order-blotter-item-details"><span class="amount">1000</span> shares of <span class="symbol">IBM</span> at Market at <span class="price">132</span></div><div class="order-blotter-item-status pending">Pending Approval</div></div>', handler: views.showOverlay }; views.orderBlotterItems.add(newItem); views.orderBlotterItems.doLayout();
-
7 Sep 2010 6:17 PM #5
The nested list is changing fairly significantly for the next release, where it will be backed by a hierarchical store, so a lot of this discussion is fairly irrelevant.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
Similar Threads
-
TabPanel (w/ TabBar) and NestedList as Content
By sjh in forum Sencha Touch 1.x: DiscussionReplies: 24Last Post: 13 Jul 2010, 1:18 PM -
Is it possible to use different components as parts of a NestedList?
By irene in forum Sencha Touch 1.x: DiscussionReplies: 1Last Post: 24 Jun 2010, 11:03 AM -
Remove Some items from toolbar and add New Items Not Working
By shajeerkt in forum Ext GWT: DiscussionReplies: 3Last Post: 15 Feb 2010, 6:28 AM -
Extending Window with items gives this.items.add is not fcn
By serff in forum Ext 2.x: Help & DiscussionReplies: 17Last Post: 8 Feb 2010, 5:03 AM -
Panel.items.add - but no new items showing
By fredrikmh in forum Ext 2.x: Help & DiscussionReplies: 11Last Post: 16 Sep 2008, 5:54 AM


Reply With Quote