PDA

View Full Version : Data not included in POST? Would prefer in params.



lcuff
19 Dec 2011, 1:03 PM
I'm struggling with my first application, trying to get the gridEdit feature to work. I load the data fine, but when I do the edit, my submit URL is posted to, but I don't see the actual data. I'd prefer to have the data in the params of the post, if there's more than one way to do this.



Ext.create('Ext.data.Store', {
storeId:'simpsonsStore',
fields:['id', 'name', 'email', 'phone'],
autoLoad: true,
autoSync: true,
proxy: {
type : 'ajax',
url : '/beta/biz_alerts/alert_admin/get_simpsons',
reader: {
type: 'json',
root: 'items',
idProperty: 'id'
},
writer: {
idProperty: 'id'
},
api: {
read : '/beta/biz_alerts/simpsons/get_simpsons',
update : '/beta/biz_alerts/simpsons/submit_simpsons',
create : '/beta/biz_alerts/simpsons/create_simpsons',
destroy : '/beta/biz_alerts/simpsons/destroy_simpsons',
}
}
});


var panel1 = Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: 'simpsonsStore',
columns: [
{header: 'Name', dataIndex: 'name', editor: 'textfield'},
{header: 'Email', dataIndex: 'email', flex:1,
editor: {
xtype: 'textfield',
allowBlank: false
}
},
{header: 'Phone', dataIndex: 'phone'}
],
selType: 'cellmodel',
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
})
],
height: 200,
width: 400,
renderTo: Ext.getBody()
});


Ext.onReady(function(){


main_container = Ext.create('Ext.container.Viewport', {
layout: 'column',
items: [ panel1 ]
});
});