extjs4 - ExtJS 4.2.1 Grid view overriden with custom XTemplate shows nothing -


i working on switch version 4.1.1 4.2.1 , need fix last bug. have gridview view being overriden simple (?) ext.xtemplate, follows:

ext.define('view.monitoring.event', {     extend: 'ext.view.view',     alias: 'widget.default_monitoring_event',      itemselector: '.monitoring-thumb-fumb',      tplwritemode: 'overwrite',     autowidth: true,      initcomponent: function()     {         var tplpart1 = new ext.xtemplate('<some html 1>');         var tplpart2 = new ext.xtemplate('<some html 2>');         var tplpart3 = new ext.xtemplate('<some html 3>');         var tplpart4 = new ext.xtemplate('<some html 4>');          this.tpl = new ext.template('<bunch of html , tpl , tpl inside tpl',             callfunc1: function(data) { /* tplpart1 */ },             callfunc2: function(data) { /* tplpart2 */ },             callfunc3: function(data) { /* tplpart3 */ },             callfunc4: function(data) { /* tplpart4 */ },         );          this.callparent(arguments;     } } 

this view set grid in way:

ext.define('view.monitoring.weeklyoverview', {     extend: 'ext.grid.panel',     alias: 'widget.default_monitoring_weeklyoverview',     layout: 'border',     title: lang.translate('event_monitoring_title'),     overflowx: 'hidden',     overflowy: 'auto',      initcomponent: function()     {         //...          this.view = ext.widget('default_monitoring_event', {             store: ext.create('store.monitoring.rows')         });          //...     } } 

then in controller onrender stores gets populated (the store of grid ajax, loads data , passes them memory store of view). in extjs 4.1.1 working properly, data loaded , template parsed , html displayed containing data.

but after switch 4.2.1 html no longer filled data , nothing displayed empty html table (which appears nothing rendered). there @ least part of html no data, guess problem might data being applied template.

does know might be/went wrong?

update: after debugging , custom view template simplification have found out, custom view has set it's own store it's own root data returned, ignores setting , loads data store of ext.grid.panel component. ajax response looks like:

{     user: {},     data: [         0: { ... },         1: { ... },         ...     ],     rows: [         0: { ... },         1: { ... },         ...     ] } 

here data should used ext.grid.panel component , rows should populated custom view (configured ext.xtemplate). seems children views parent's store's root element returned. any way how workaround behaviour , make custom view use it's own store???

finally found solution.

the problem after main grid.panel loaded data distributed them it's (sub)view. after had manually loaded right data custom xtemplate, needed manually override rendered view.

in controller (init -> render) needed this:

    var me = this;     this.getmainview().store.load({         params: params || {},         callback: function(records, operation, success) {             // line there, working extjs 4.1.1, useless extjs 4.2.1 next line             me.getcustomview().store.loadrawdata(this.proxy.reader.rawdata);             // had add line extjs 4.2.1...             me.getcustomview().tpl.overwrite(me.getcustomview().el, this.proxy.reader.rawdata.rows);         }     }); 

this kinda strange thought definition within custom view (see question above)

tplwritemode: 'overwrite', 

it should automatically overwrite it's view...


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -