There is a button on it hangs Event
editFiletype : function(btn, e) {
var r = {
'id' : MODx.request.id,
'd' : this.menu.record.i,
'key' : this.menu.record.key,
'name' : this.menu.record.name,
'service' : 'MODX'
};
if (!this.windows.EditFiletype) {
this.windows.EditFiletype = MODx.load({
xtype : 'advicles-window-filetypeedit',
record : r,
listeners : {
'success' : {
fn : function(r) {
this.refresh();
},
scope : this
}
}
});
}
this.windows.EditFiletype.setValues(r);
this.windows.EditFiletype.show(e.target);
},
Opens a window with the form:
Advicles.window.EditFiletype = function(config) {
config = config || {};
this.ident = config.ident || 'advimp' + Ext.id();
Ext.applyIf(config, {
title : "Редактировать тип файлов",
id : this.ident,
url : "/assets/components/advicles/filetypelist.php",
action : 'edit',
fields : [{
xtype : 'hidden',
name : 'id',
value : MODx.request.id
}, {
xtype : 'hidden',
name : 'd',
value : MODx.request.d
}, {
xtype : 'textfield',
fieldLabel : "Key",
name : 'key',
id : 'modx-filetype-key',
value : MODx.request.key
}, {
xtype : 'textfield',
fieldLabel : "Name",
name : 'name',
id : 'modx-filetype-name',
value : MODx.request.name
}]
});
Advicles.window.EditFiletype.superclass.constructor.call(this, config);
};
Ext.extend(Advicles.window.EditFiletype, MODx.Window, {
activeOptions : 'advicles-options-MODX',
changeService : function(cb, s) {
var nv = cb.getValue();
var op = Ext.getCmp(this.activeOptions);
var nop = 'advicles-options-' + nv;
var p = Ext.getCmp(nop);
if (p) {
op.hide();
p.show();
this.activeOptions = nop;
}
return true;
}
});
Ext.reg('advicles-window-filetypeedit', Advicles.window.EditFiletype);
However, when the store shape in the window, it hangs up. The data in the file is sent, but the response is obtained in the processing error (firefox):
TypeError: g is undefined
var g = this.getRoot(a), e = g.length, d = e, k = true;
File filetypelist.php - I wrote myself, so I can make it any conclusion. Which json should be returned to the error from occurring? Tried {"success": true} - does not work.
Help me, please.
PS Sorry for the bad English
file filetypelist.php:
$arr = array();
$arr['success'] = true;
header('Content-type: text/json; charset=utf-8');
echo(json_encode($arr));