PDA

View Full Version : clear store error



kjcr
5 Mar 2013, 12:00 AM
hello*^^*.

i make list
my store's proxy type:'memory'

at first
when data is come in, i insert the data into store.
then i set


store.removeAll()

then i add another data to store
but error occur



Uncaught TypeError: Cannot read property 'internalId' of undefined ext-all-debug-w-comments.js:88860Ext.define.updateIndexesext-all-debug-w-comments.js:88860Ext.define.onAddext-all-debug-w-comments.js:88790Ext.util.Event.Ext.extend.fireext-all-debug-w-comments.js:13624Ext.define.continueFireEventext-all-debug-w-comments.js:35235Ext.define.fireEventext-all-debug-w-comments.js:35206Ext.define.insertext-all-debug-w-comments.js:72928Ext.create.listeners.itemclickapp.js:3010Ext.util.Event.Ext.extend.fireext-all-debug-w-comments.js:13624Ext.define.continueFireEventext-all-debug-w-comments.js:35235Ext.define.fireEventext-all-debug-w-comments.js:35206(anonymous function)ext-all-debug-w-comments.js:35610Ext.util.Event.Ext.extend.fireext-all-debug-w-comments.js:13624Ext.define.continueFireEventext-all-debug-w-comments.js:35235Ext.define.fireEventext-all-debug-w-comments.js:35206Ext.define.processUIEventext-all-debug-w-comments.js:145482Ext.define.handleEventext-all-debug-w-comments.js:145394(anonymous function)wrap


also i use other thing



store.getProxy().clear();
store.sync();




store.getProxy().clear();
store.data.clear();
store.sync();


but still same error is occur.
please help me.

mitchellsimoens
7 Mar 2013, 8:51 AM
Not knowing much (not much real info specified above), this simple test case worked for me:


var store = new Ext.data.Store({
fields : ['foo'],
data : [
{ foo : 'bar' }
]
});

store.removeAll();

store.add([
{ foo : 'blah' }
]);