PDA

View Full Version : Grid store not sending all fields when saving



bbxx
18 Nov 2009, 8:53 PM
Can someone help me figure out why my grid's store is not sending all of my record parameters on a create command? It is only sending:

formulaID 2
results {"ID":"ext-record-154"}
task FORMULA_CALC_FROM


function getFormulaCalcFromStore()
{
var formulaCalcFromStore = new Ext.data.Store({
name:'formulaCalcFromStore',
autoLoad: false,
autoSave: false,
sortInfo:{field: 'keyName', direction: "ASC"},
reader: reader = new Ext.data.JsonReader({
isData : function(data) {
return (data && Ext.isObject(data) && !Ext.isEmpty(this.getId(data))) ? true : false;
},
root: 'results',
idProperty: 'ID',
}, [
{name: 'ID', type: 'int', mapping: 'ID'},
{name: 'keyID', type: 'int', mapping: 'keyID'},
{name: 'keyType', type: 'string', mapping: 'keyType'},
{name: 'keyName', type: 'string', mapping: 'keyName'},
{name: 'salesCode', type: 'string', mapping: 'salesCode'}
]),
proxy: new Ext.data.HttpProxy({
url: 'AppTasks.php', // File to connect to
method: 'POST',
api: {
read : 'AppTasks.php?api=read',
create : 'AppTasks.php?api=create',
update : 'AppTasks.php?api=update',
destroy : 'AppTasks.php?api=destroy'
}
}),
baseParams:{task: "FORMULA_CALC_FROM", formulaID:0},

writer: new Ext.data.JsonWriter({
writeAllFields:true
}),
exception : function(proxy, type, action, options, res, arg) {
if (type === 'remote') {
Ext.Msg.show({
title: 'REMOTE EXCEPTION',
msg: res.message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
}
}
});

return formulaCalcFromStore;
}