PDA

View Full Version : rowediting overload + direct proxy = url is undefined



Forn
25 Apr 2012, 1:58 PM
Hello. I have the next code:


Ext.define('xxx.view.tabs.TabOperationSystemList', {
extend: 'Ext.panel.Panel',
alias: 'widget.tabOperationSystemList',

layout: {
type: 'border'
},

initComponent: function() {
var me = this;

Ext.applyIf(me, {
items: [
{
xtype: 'gridpanel',
id: 'gridOperationSystem',
title: 'test',
autoScroll: true,
region:'center',

store: {
model: 'xxxx.model.ModelOperationSystem',
autoLoad: true,
proxy: {
type: 'direct',
api: {
create: EXTJSActionListener.direct_createOperationSystem_All,
read: EXTJSActionListener.direct_getOperationSystem_All,
update: EXTJSActionListener.direct_updateOperationSystem_All,
destroy: EXTJSActionListener.direct_deleteOperationSystem_All
}
}
},

plugins: [{
ptype: 'rowediting',
clicksToMoveEditor:1,
autoCancel: false
}],

columns: [
{
dataIndex: 'a_ouid',
header: 'id',
flex: 1
},
{
dataIndex: 'a_name',
header: 'name',
flex: 4,
editor: {
xtype: 'textfield',
allowBlank: false
},

}
],

dockedItems:[{
xtype: 'toolbar',
dock: 'bottom'
}]
}
],
});

me.callParent(arguments);
}
});


And have actio:


/**
* Ext.grid.plugin.Editing edito
* Object e
* Object eOpts
*/
gridOperationSystem_onSave: function(editor, e, eOpts){
e.record.save();
}


But when i clikc update button in rowedition i get the next error:


url is undefined

error source line:

chrome://firebug/content/blank.gif


return url + (url.indexOf('?') === -1 ? '?' : '&') + string;



I think this is because in dont think that the proxy is direct.

I use 4.1 version

Forn
25 Apr 2012, 2:06 PM
when i change to:
e.store.sync();

It's look like work. But i will testing it tomorow.

maneljn
26 Jun 2012, 1:54 AM
i have the same problem , when i do anymodel.save() i got the error url is undefined.



// Modelo de datos para las aplicaciones definidas
Ext.define('esinube.model.esicontrol.aplicacion', {
extend: 'Ext.data.Model',
fields: [
{ name: 'apl_id', type: 'integer' },
{ name: 'apl_guid', type: 'string' },
{ name: 'apl_nombre', type: 'string' },
{ name: 'apl_descripcion', type: 'string' },
{ name: 'apl_nombre_interno', type: 'string' },
{ name: 'apl_accdir_controller', type: 'string' },
{ name: 'apl_accdir_fn', type: 'string' },
{ name: 'apl_activo', type: 'boolean' },
{ name: 'apl_fechaalta', type: 'date', dateFormat: 'Y-m-d H:i:s' },
{ name: 'apl_fechamod', type: 'date', dateFormat: 'Y-m-d H:i:s' }
]
});




// Store para las aplicaciones definidas
Ext.define('esinube.store.esicontrol.aplicaciones', {
extend: 'Ext.data.Store',

requires: [
'esinube.model.esicontrol.aplicacion'
],

constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
autoLoad: false,
autoSync: false,
buffered: false,
model: 'esinube.model.esicontrol.aplicacion',
remoteSort: true,
pageSize: 50,
proxy: {
type: 'direct',
batchActions: false,
paramAsHash: true,
extraParams: {
buscar: null
},
api: {
read: Ext.esinubeDirect.esicontrol_aplicaciones.getAplicacionesTodas,
create: Ext.esinubeDirect.esicontrol_aplicaciones.createAplicacion,
update: Ext.esinubeDirect.esicontrol_aplicaciones.updateAplicacion,
destroy: Ext.esinubeDirect.esicontrol_aplicaciones.destroyAplicacion
},
reader: {
type: 'json',
root: 'data',
idProperty: 'apl_id',
totalProperty: 'total',
successProperty: 'success'
}
}
}, cfg)]);
}

});