PDA

View Full Version : ComboBox selections seem too sticky



Ben
14 Jun 2007, 1:08 AM
Hi,
I'm building a modal popup search panel for my application, which has a little search form, a button to submit the search to the server, and a grid to receive the results. Double-clicking on a row in the grid hides the search panel and creates a panel in my 'center' region of the main screen. All great so far, thanks to ExtJS, however I have two issues:

Issue 1) I have two combo boxes in the search form which are of this form:



var eouStatusField = new Ext.form.ComboBox({
editable: false,
fieldLabel: 'Status',
hiddenName:'eouStatus',
store: new Ext.data.SimpleStore({
fields: ['code', 'name'],
data : Hisl.data.eouStatus // from constants.js
}),
displayField:'name',
valueField: 'code',
mode: 'local',
emptyText:'Select a status...',
width: 130
});


After submitting my search, the search panel stays visible (as intended), ready for a new search. However, unless I reset the form in the submit method, I cannot make the ComboBoxes go back to selecting nothing (so as to search by name or id instead of status).

Can anyone help?

Issue 2) This is more of a 'have I found a bug, or a feature?' issue. As above, I'm doing multiple searches from my form, however, if the results Grid gets a row from the first search, the containing div gets fixed at the height required for one row. However, this height is sticky, so that when I do a new search, returning multiple rows, only one shows, despite the PagingToolbar showing records '1-15 of 1523' (for example). The work-around for this is to reset the height of the Grid div to zero, before re-creating a Grid object for the new search.



// collapse the grid container so that the new grid sizes the container
Ext.get('countries-browser-grid').setHeight(0);

// create the grid
var grid = new Ext.grid.Grid('countries-browser-grid', {
selModel: new Ext.grid.RowSelectionModel({singleSelect:true}),
ds: ds,
cm: cm
});


Is this a bug? Or a feature?

Regards,
Ben