View Full Version : Strange top bar in IE and grid sorting problem

4 Jul 2009, 9:21 PM

I've developed an editor grid + form Ext 3.0 script with CRUD and Search functions for a php+MySQL backend application. It was working fine with editor grid columns sortable at the beginning.

I ported this script to other application, in which I needed to change somethings as follows:
1. change some field names and add and remove some fields.
2. Add field level pull-down menu for two fields at the editor grid row.
3. For the pull-down menu, I added two simple array stores to the script. The array stores get Json array data by javascript variables created on the fly by php before the grid is created.

The porting is basically working fine with all CRUD and new field level pull-down menu working ok. There are no any javascript error found by IE 8, Firefox and google Chrome.

However, after testing, I found some strange things:
1. The top bar height is incorrect (shorten) in the grid (see grid1 image (http://extjs.com/forum/attachment.php?attachmentid=14745&stc=1&d=1246769605) ) in IE8 but it is correct after I click any button (e.g. Search) on the top bar (see grid2 image (http://extjs.com/forum/attachment.php?attachmentid=14746&stc=1&d=1246769875) ). No such problem found in other browsers e.g. Firefox, Chrome and Opera. (see grid3 image (http://extjs.com/forum/attachment.php?attachmentid=14747&stc=1&d=1246769875) ).

2. The visual height of the grid is slightly shorter in IE8 than other browsers (Firefox and Chrome). The grid height value is fixed and same in the script for all browsers.

3. The column sorting is not allowed (the Ascending and Descending sorts are disable) in any browser (IE8, Firefox and Chrome..etc) but it was working fine before the porting. I have not changed the following statement in the script, which should enable the column sorting in the grid.

// by default columns are sortable, colMod is the Column Model
colMod.defaultSortable = true;

Since there is no any javascript error, I don't know what is wrong with my porting script or there may be some hidden bugs in my script or Ext 3.0 column sorting method.

Hope to get some advices.


17 Jul 2009, 12:02 PM
Try moving the sortable declaration to the ColumnModel's config. We're having the same problem with defaultSortable. There's code there to catch it but it doesn't seem to be working in our case either.

Try something like this...

var colModel = new Ext.grid.ColumnModel({
columns: [
{ header: "Name", id: 'name'},
{ header: "Favorite Pizza" },
{ header: "Likes Root Beer?", resizable: false}
defaults: {
sortable: true,
width: 120

Not sure about the topbar and height issues.