PDA

View Full Version : uncaught exception while trying to use a paging toolbar in a Grid



Srikanth474
22 Feb 2012, 8:40 AM
Hi,

I have created a viewport with border layout. i have a toolbar on north region and a panel on center region. on selection of a menu item in the toolbar, i have to show different panel in center region. instead of using card layout i am using removeAll() method to remove the center region panel and add a new panel component using Ext.ComponentMgr.create.

I have around 9 menu items so i have 9 different panels, which in turn have a form panel and a grid panel in each of them. Every thing is working great untill i implemented paging toolbar for the grid inside the panel. After loading the page when i click on the menu item which has the paging toolbar it renders property and when i click on a another item no issues, but come back to the item which has the paging toolbar it does not render and shows an uncaught exception in Fire Bug.

uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMHTMLDivElement.insertBefore]" nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)" location: "JS frame :: http://localhost:8080/AOWeb/js/sencha4-base/ext-all-debug.js :: <TOP_LEVEL> :: line 15532" data: no]
http://localhost:8080/AOWeb/js/sencha4-base/ext-all-debug.js
Line 394


the ways i am trying to create the paging tool bar is

// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: Ext.data.StoreManager.lookup('contractGridStore'),
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No topics to display",
}),

i also tried this
dockedItems:
[{
xtype: 'pagingtoolbar',
store: Ext.data.StoreManager.lookup('requiredFieldStore'), // same store GridPanel is using
dock: 'bottom',
displayInfo: true
}],

I think this has something to do with the removeAll() function i am using.

Thanks in Advance,
Srikanth

Tim Toady
22 Feb 2012, 9:03 AM
removeAll will (based on autoDestroy) invoke the destroy function for each component. Passing false as a param to removeAll will prevent this :/ Hope I understood your question.

Srikanth474
22 Feb 2012, 9:38 AM
Thank you for giving me some light about it. Exception is not thrown when i am sending false as a param to removeAll. but when i comeback to the panel which has the grid with paging toolbar,the grid columns are shown property but the paging toolbar and the grid column headers are disappearing.

I am not able to understand the weird behavior.