if(l && l.fireFn.apply(l.scope || me.obj || window, args) === FALSE) {
mensaje : l.fireFn.apply is not a function,
{...., "handler" : eval("com.App.Objeto.Metodo"), ....}
// funcion del evento
getMenu: function (toolbar) {
Ext.Ajax.request({
disableCaching: false,
url: '/modules/Menu.asmx/get',
scripts: true,
headers: {
'Content-Type':'application/json',
'charset' : 'utf-8'
},
success: function(response,options) {
var data = eval(Ext.util.JSON.decode(response.responseText));
toolbar.add(data.d._menuItems);
toolbar.doLayout(); // este metodo no hace falta llamarlo, es para asegurarme que se dibujen :P
},
failure: function(response,options) {alert('fallo')}
});
}
// en la region donde quiero colocar el menu dentro del panel
{
region: 'north',
autoHeight: true,
border: false,
items: [{xtype: 'toolbar', listeners: {beforerender: this.getMenu}}]
}
preOrderRec(root) {
if(!Ext.isEmpty(root.handler))
// convertir {..,"handler": "com.App.Objeto,metodo", ...}
// {..,"handler": com.App.Objeto,metodo, ...}
// para que el metodo pueda ser llamado por el error ya mencionado
root.handler = eval(root.handler)
}
if(!Ext.isEmpty(root.menu)) {
for(it in root.menu) {
preOrderRec(root.menu[it]);
}
}
{
"xtype" : "button",
"text" : "Nuevo",
"icon-cls" : "nuevo-icon",
"klass" : "Quizz.training.MiModulo",
"method" : "nuevo"
}
var btn = Ext.decode(response.responseText);
Quizz.training.LoadManager.loadScript(btn.klass,function(){
btn.handler = window[btn.klass][btn.method];
btn.scope = window[btn.klass];
toolbar.add(btn);
});
It looks like you're new here. If you want to get involved, click one of these buttons!
The content of this site is copyrighted by Quizzpot.com, it is prohibited to publish our tutorials on other blogs, magazines or any other media without prior permission.
Copyright © 2012 Quizzpot.
Our visitors are mostly developers and Web designers, advertise with us, you only need to contact us .