view
Code:
Ext.define("Bleext.f.view.TicketsGrid",{
extend : "Ext.grid.Panel",
store : "Bleext.f.store.Tickets",
border : false,
rowEditor: Ext.create('Ext.grid.plugin.RowEditing', {
clicksToEdit: 2
}),
initComponent : function() {
var me = this;
me.columns = {
items:[
{xtype: 'checkcolumn',header:"Ok",dataIndex:"Ok"},
{header:"Id_Article",dataIndex:"Id_Article",editor: 'textfield'}
],
defaults: { flex: 1}
};
me.callParent();
this.plugins = [ this.rowEditor ];
}
});
model
Code:
Ext.define("Bleext.f.model.Ticket",{ extend : "Ext.data.Model", //<-- Herencia
fields : [
{name:"Ok",type:"integer"},
{name:"Id_Article",type:"integer"}
]
});
store
Code:
Ext.define("Bleext.f.store.Tickets",{
extend : "Ext.data.Store",
model : "Bleext.f.model.Ticket",
autoSync: true,
autoLoad: true,
proxy: {
type: 'ajax',
url : 'data/api.php',
api: {
create : 'data/apiu.php',
read : 'data/api.php',
update : 'data/api.php?action=update',
destroy : 'data/api.php'
},
reader: {
type: 'json',
root: 'data'
},
writer: {
type: 'json',
root: 'data',
writeAllFields : true
}
}
});
When I click on the checkbox, the firebug writes that
Code:
({"success":true,"data":{"Ok":true,"Id_Article":4369126}})
php file
Code:
$r = json_decode($HTTP_RAW_POST_DATA,TRUE);
echo print_r($r);
So, the Ok field don't have value so, after that the Update cannot work properly
Array( [data] => Array ( [Ok] => [Id_Article] => 4369126 [id] => ))