-
8 Mar 2011 4:10 AM #1
Create a grid with all rows selected at opening
Create a grid with all rows selected at opening
I searched through the forum ,but actually i didn't find a solution to this.
I have a Grid with a certain number of records and a CheckBoxSelectionModel.
What i want to do is to see all the rows selected after the grid is rendered.
Actually, this is the code i use but does not do to job.
I tried to fire the event Events.HeaderClick after setting the selection model but it doesn't fire at allCode:Grid<ModelData> grid = new Grid<ModelData>(TestData.getStore(), TestData.getColumnModel()); final CheckBoxSelectionModel<ModelData> sm = new CheckBoxSelectionModel<ModelData>(); sm.setSelectionMode(SelectionMode.SIMPLE); grid.setSelectionModel(sm); grid.selectionModel.selectAll();

Where is the mistake?
thanks for the help
-
8 Mar 2011 6:47 AM #2
Seems that the only way to do this is only when the Grid is attached ..
Here it works.Code:@Override protected void onAttach() { super.onAttach(); selectionModel.selectAll(); }
Similar Threads
-
Use selected rows in Grid 1 to create Grid 2 in new window
By papadiddy in forum Ext 3.x: Help & DiscussionReplies: 0Last Post: 12 Nov 2009, 8:22 PM -
Set all rows in grid to be selected
By jpartogi in forum Ext GWT: DiscussionReplies: 1Last Post: 4 Nov 2009, 10:16 AM -
Grid with rows pre-selected
By harsha_velicheti in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 3 Nov 2009, 8:31 AM -
Getting Selected Rows Data from Grid
By Manish Roy in forum Ext 2.x: Help & DiscussionReplies: 7Last Post: 10 Jun 2008, 3:55 AM -
getting selected rows in a grid
By ericwaldheim in forum Ext 1.x: Help & DiscussionReplies: 3Last Post: 9 Oct 2006, 10:58 AM


Reply With Quote