PDA

View Full Version : Cannot remove from Store if object model has an array



iamcootis
17 Dec 2013, 12:59 PM
I have an object model that looks like this



Ext.define('ME.model.testseries.TestSeriesModel', {
extend: 'Ext.data.Model',
fields: [
{
// dummy entry, will be used only for internal purpose during creating a new
// Test series entry
name: '__id'
},
{
name: 'name',
mapping: '_name'
},
{
name: 'class',
mapping: '_class'
},
{
name: 'testmodel',
type: 'array'
},
{
name: 'createdBy',
mapping: '_createdBy'
},
{
name: 'createdOn',
mapping: '_createdOn'
}

]
});


the testmodel array can hold an array of test objects.

If I only create a TestSeriesModel without any testmodel objects in the array, I can call. store.removeAt(index); and it will remove it.

If the TestSeriesModel has one or more testmodel objects in the array and I try to remove it from the store, it doesn't remove it.

Has anyone ever had a similar problem?

Gary Schlosberg
3 Jan 2014, 10:05 AM
I haven't heard of this issue, and unfortunately I couldn't reproduce it. Can you post a test case which reproduces the issue?

AkshayKalbhor
24 Feb 2014, 4:08 AM
Even I am facing the same issue,
I want to know if the thing that i am trying to do possible at the first place.

Code:
Ext.define('Menu.model.MenuModel', {
extend: 'Ext.data.Model',
fields: ['title', 'index', 'iconCls', 'children[]']
});

and also "menuItems.json" looks like

{
'success': true,
'menuItems': [
{


'title': 'CAMPAIGN',
'index': '1',
'iconCls': 'campaign',
'children': [


{


'title': 'child1',
'index': '11',
'iconCls': 'child1'

}, {


'title': 'child2',
'index': '12',
'iconCls': 'child2'

}, {


'title': 'child3',
'index': '13',
'iconCls': 'child3'

}

]

}]
}