I was wondering if there is any way to pass an array of objects as extra param of model.save method ?
For simple types params seem to work.
Ext.define('RightGridModel', {
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: 'int'},
{name: 'rightText', type: 'string'},
{name: 'digit',type:'int'}
]
});
var mod = Ext.create('RightGridModel');
mod.set('rightText', 'some text');
mod.save({
url: "Home/Insert",
params: {
par: 'additional parameter'
}
});
However if I want to send and array as an extra param,(of course I changed server side function to be approperiate ) par variable is an empty list. Here is a code I use to send an model and array
mod.save({
url: "Home/Insert",
params: {
par: Ext.encode(array)
}
});
Is there any way to send a model and an array as extra parameter ?? What is the best way to achieve that ?
Check out
getParamsfunction of Proxy class. You can just subclass existing proxy classes into your own and use it while communicating with your backend.