PDA

View Full Version : removeAt or remove does not work in extjs3



kumar_Rajesh78
6 Nov 2013, 5:39 PM
I have this big problem where 'store.remove' is calling the URL defined under 'destroy', but in the view the record does not disappear. I am struggling like hell with these. Could someone please help.
I really appreciate it.

Thanks a lot.

This is my code:


tbar:[{text: 'Remove Item',
handler: function(){
var sm = Ext.getCmp('durationOut').getSelectionModel();
var selected = sm.getSelected();
if(sm.hasSelection()){
Ext.Msg.show({
title:'Remove Item',
buttons: Ext.MessageBox.YESNOCANCEL,
msg: 'Remove ' + '?',
fn: function(btn) {
if(btn == 'yes'){
var store = Ext.getCmp('durationOut').getStore();
var index = store.indexOf(selected);
alert(index);
store.removeAt(index);
store.save();
}
}
})
}
}},


also the store is defined as:


DurationOutResultsStore.superclass.constructor.call(this, {
autoLoad: true,
autoSave: true,
proxy: durationProxy,
root: 'durationContainers',
reader: {
type: 'json',
idProperty: 'id',
successProperty: 'success',
root: 'durationContainers',
messageProperty: 'message'
},
writer: {
encode: true,
writeAllFields: true,
root: 'durationContainers'
},
fields : [
{
name: 'id'},
{

slemmon
11 Nov 2013, 3:21 PM
Is the store using a MemoryProxy or an HttpProxy?