PDA

View Full Version : xaction: always show 'create' and 'read' only where the 'delete'?



norizam61
17 May 2010, 2:38 AM
I got my store




var writer = new Ext.data.JsonWriter({
encode: false // <-- don't return encoded JSON -- causes Ext.Ajax#request to send data using jsonData config rather than HTTP params
});


var sr_s_subjregist = new Ext.data.Store({
autoLoad: true,
id: 'remoteSmResDetail',
writer: writer,
proxy: new Ext.data.HttpProxy({
method: 'POST',
url: 'app/php/smResultDetail.php'

}),
reader: new Ext.data.JsonReader({
root: "data" ,
totalProperty: "total",
idproperty: ['dt_id', 'dt_loc3', 'dt_subject', 'dt_semester', 'dt_section'],
fields: ['dt_id', 'dt_loc3', 'dt_subject', 'dt_semester', 'dt_section', 'dt_desc_02', 'dt_cp', 'dt_point']
})
});


Operation for deletion




function onDelete() {
editor.stopEditing();
var rec = sr_s_subjregist.getSelectionModel().getSelected();
if (!rec) {
return false;
}
sr_s_subjregist.remove(rec);
};


The problem is 'xaction' pass to writer is always 'create' when remove action fires!, do I miss something? !

:-/

Condor
17 May 2010, 3:04 AM
1. It's idProperty and not idproperty.
2. Specifying an array for the idProperty is not supported. You need a unique id field (which could simply be a string containing the values of every field in the array).
3. Are you returning a the complete record (including the new id) for a create action?

norizam61
17 May 2010, 3:18 AM
Hi Condor

1. 2. - I have changed the code, but seem like the 'xaction' not fired at all.
3 - Yup I'm returning complete record ... i meant the old record that i intend to remove.

Very much thank u for quick reply.