-
24 May 2009 10:42 PM #11
put EditorGridPanel in tabpanel, the first time,the editor box it's work, but in the second time it's not work.(In IE6).and then take the try{} catch(){}, it's not work also.
i guess the editor it's removed,but the event or other things attached.
In the seconde time,when event occured,the editor removed from dom trigger the error.
so, i give up use EditorGridPanel in tabpanel,but in window, that's work fine.
any one can give me suggestion?
-
26 May 2009 12:56 AM #12
don't inherit from EditorGridPanel, put it to tabpanel
don't inherit from EditorGridPanel, put it to tabpanel
while i define a class base window,and EditorGridPanel is a control in window, and initialize in initComponent method, then it's work fine。
so, i guess it's not error from extjs. maybe, it's the design way fault.
the error way:
the correct way:Code:Ext.extend(Ext.grid.EditorGridPanel,{ cm:new Ext.grid.ColumnModel ([ {header: "....", sortable:true,width: 100, dataIndex:"UploadDate",editor:new Ext.form.TextField({allowBlank: false})}, ]) ,..... });
now,i define the class base on Panel, put it on tabpanel,EditorGridPanel editor works fine.Code:Ext.extend(Ext.Panel,{ id:"NSBD_SYS_FigureProgressAdd", autoScroll:true,//滚动选项 lazyLoad:true, layout:"border", title:"......", initComponent : function() { //debugger; FigureProgressAdd.superclass.initComponent.call(this); var gridconfig = { id:"FigureProgressAdd_grid", region:"center", cm:new Ext.grid.ColumnModel ([ {header: ".....", sortable:true,width: 100, dataIndex:"UploadDate",editor:new Ext.form.TextField({allowBlank: false})} ,..... ]), }; this.grid = new Ext.grid.EditorGridPanel(gridconfig ); this.add(this.grid); this.grid.refresh(); } });
when inherit from EditorGridPanel, the config initilize once, but when close the EditorGridPanel from tabpanel; in the second time, the created editor destroy from EditorGridPanel()[extjs 2.1],all editors destroy from EditorGridPanel()[extjs 2.2.1].
so ,when click the cell,exceptions throw.
use this one, should put colmodel as a user config, not a inner part.Last edited by mystix; 26 May 2009 at 12:58 AM. Reason: post code in [code][/code] tags!!!
-
26 May 2009 7:02 AM #13
another way to avoid editor missing
another way to avoid editor missing
the question like "has a" or "is a" question in oop. but, javascript is a object base language, the "class" template is a instance alse.Code:Ext.extend(Ext.grid.EditorGridPanel,{ .....,....., initComponent : function() { this.cm =new Ext.grid.ColumnModel ([ {header: ".....", sortable:true,width: 100, dataIndex:"UploadDate",editor:new Ext.form.TextField({allowBlank: false})} ,..... ]); FigureProgressAdd.superclass.initComponent.call(this); this.grid.refresh(); });
in the error way, cm just create once. but when close the extended EditorGridPanel,the cm's editor is destroyed, when new the extended EditorGridPanel,the cm not created again in the error way,so the editor is missed.
the solution is to make sure the cm object created in every new instance
-
29 Sep 2009 6:23 AM #14
one more scenario where this bug kicks in:
a ComboBox when it binds to a store it hooks on to its beforeload event. in the onBeforeLoad handler there's the following code:
of course if "load" event is fired on the bound store, the combobox will show loading indicator, which messes with the dom, this.restrictHeight() calls getXY() which in turn accesses offsetParent and inevitably triggers the ever so helpful "Unspecified Error".Code:// private onBeforeLoad : function(){ if(!this.hasFocus){ return; } this.innerList.update(this.loadingText ? '<div class="loading-indicator">'+this.loadingText+'</div>' : ''); this.restrictHeight(); this.selectedIndex = -1; },


Reply With Quote