Updating template data extjs -
i making window panel holds tpl
config , have passed config named recordref
window component following, wish update tpl
config data in recordref.
rowdblclick: function(view, record,element,rowindex,e,eopts){ var me = this; ext.create('mywindow',{ recordref: record }); }
my window looks this
ext.define('mywindow',{ extend: 'ext.window.window', alias: 'widget.details', controller: 'details', ghost: false, constrain: true, title: 'details', modal: true, resizable: false, autoscroll: true, items: [ { xtype: 'panel', reference: 'infopanel', items: [ { xtype: 'panel', tpl: ['<p>name: {name}</p>', '<p>age: {age}</p>'], listeners: { render: 'updatetpl' } }, ... other items ... ] } ] });
and function updatetpl
in window's controller looks like
updatetpl: function(panel, eopts){ var me = this; var view = me.getview(); var record = view.recordref; panel.update(record); }
this code leads error
app.js?_dc=1502746390069:102863 uncaught typeerror: cannot set property 'innerhtml' of null @ constructor.overwrite (app.js?_dc=1502746390069:102863) @ constructor.overwrite (app.js?_dc=1502746390069:51335) @ constructor.update (app.js?_dc=1502746390069:65016) @ constructor.updatetpl (app.js?_dc=1502746390069:180214) @ constructor.fire (app.js?_dc=1502746390069:18721) @ constructor.dofireevent (app.js?_dc=1502746390069:19625) @ constructor.dofireevent (app.js?_dc=1502746390069:62695) @ constructor.prototype.dofireevent (app.js?_dc=1502746390069:52784) @ constructor.fireeventargs (app.js?_dc=1502746390069:19478) @ constructor.fireevent (app.js?_dc=1502746390069:19437)
what doing wrong here?
pass data object panels update function.
panel.update(record.getdata());
the update function expects htmlordata first parameter. well:
panel.update({ name: record.get('name'), age: record.get('age') })
Comments
Post a Comment