PDA

View Full Version : grid tbar SearchField errors out



siberian
22 May 2010, 9:48 PM
I am adding a Ext.ux.Form.SearchField to the toolbar of a grid and getting the error


tb.doLayout is not a function
[Break on this error] tb.doLayout();
ext-all-debug.js (line 15550)

This is causing problems in my other ext direct loading code (it never gets called if this crashes the interpeter).

If I take out the tbar all is well.

Anyone have any ideas? I vaguely am understanding MAYBE what is happening is that the tbar is trying to render itself before its container is rendered but I can't seem to discover how to make the tbar wait since its integral to the container.

Anyone seen this before?

Here is my widget build. myapp-sposorsearch-grid is just a grid with a ext-direct store attached. SponsorAccordion is just an accordion widget with a bunch of other xtype items in it.


MyApp.Sponsors = {
title: 'Sponsors',
layout: 'border',
autoScroll: true,
items: [
{
xtype: 'myapp-sponsorsearch-grid',
searchTitle: 'Sponsors',
columns: [
{ header: 'Sponsor', sortable: true },
{ header: 'Sales Agent' },
{ header: 'Priority' }
],


fbar: [
{ text: 'New Sponsor' }

],
tbar: new Ext.ux.form.SearchField({
store: sponsorPagedListStore,
//width:320,
emptyText: 'Search' + (this.searchTitle ? (' ' + this.searchTitle) : ''),
anchor: '100%'
}),
// paging bar on the bottom
bbar: new Ext.PagingToolbar({
pageSize: 15,
totalProperty:'total',
store: sponsorPagedListStore,
paramsAsHash: false,

displayInfo: true,
displayMsg: 'Displaying Sponsors {0} - {1} of {2}',
emptyMsg: "No Sponsors to display",

}),
region: 'west',
width: 200
},
MyApp.SponsorAccordion

]
};

siberian
22 May 2010, 9:50 PM
Missed an important note:

If I add a simpler widget, like a TextField or Ext.Button, it works fine. Something about Ext.ux.Form.SearchField is making it unhappy