PDA

View Full Version : CheckboxSelectionModel - selectAll() not appearing



Sigma
11 Aug 2009, 9:21 AM
Hi,

I have a GridPanel with CheckboxSelection in a FormPanel. I want all checkboxes selected by default. I did that using this:
Ext.getCmp('gridid').selModel.selectAll(); The problem is that the checkboxes are not visually checked (however, I know that they are checked because it requires 2 clicks to check them visually). Has anyone experienced a similar problem or knows what's wrong? Thank you for your help.

Condor
11 Aug 2009, 10:11 AM
It's a question of timing. You have to select the records AFTER they are rendered.

The recommended order is:
1. Render the grid.
2. Load the store.
3. In the callback or load event select all records.

Sigma
11 Aug 2009, 10:38 AM
Thanks for helping, Condor. Here's what I did:

1. Initialize/render grid.
2. Load store (I used loadData() to load from another javascript file)
3. selectAll()


Now I actually see all the checkboxes checked for a split second and then they become unchecked again. Any ideas as to what I should do?

Condor
11 Aug 2009, 10:01 PM
As I said, select all records from the store load callback or load event.

base698
18 Mar 2011, 12:02 PM
I have it doing this in the load event and am experiencing the same problem. It only happens in Firefox and IE 6, 7, 8.

Using Ext 2.2