PDA

View Full Version : Add a new item on NestedList but I can't select on this item



steven000
3 May 2011, 7:48 PM
Hello guys

I met the issue with NestedList.
My case: I add a new item to NestedList with code below:



Ext.Ajax.request({
url : context + '/users/add',
params: form.getValues(),
method: 'POST',
success: function (result) {
var obj = Ext.util.JSON.decode(result.responseText);
if (obj.res == 1) {
Ext.Msg.alert('Success', obj.msg);

var activeList = nestedList.getActiveItem();
var listItem = Ext.ModelMgr.create({
'username' : obj.user.username,
'leaf' : true
}, 'ListItem');

activeList.store.add(listItem);
activeList.store.sync();
nestedList.doLayout();
} else {
Ext.Msg.alert('Failed', obj.msg);
}
},
failure: function (result) {
var obj = Ext.util.JSON.decode(result.responseText);
Ext.Msg.alert('Failed', obj.msg);
}
});


Add successfully to store of NestedList, but when i can't select on this item. I click on this item, it keeps and moves whole panel of NestedList ???

What is missing at here ?

Thanks for advance