Be sure your post includes:
HI,
1. I am using SmartGWT version as below:
SmartClient Version: v8.3p_2013-01-12/LGPL Development Only (built 2013-01-12)
2. Browser is firefox 12.0 (Mozilla firefox for Ubuntu)
Requirement:
I am using a ListGrid, which is grouped by one of the fields. (I am using the showcase example http://www.smartclient.com/smartgwt/showcase/#grid_grouping_modes, which is grouped by hemisphere).
If the selection focus on the 1st row of a grouped listgrid, and up arrow is pressed again, I want the focus to still remain in ths first row. But the default behavior seems to be that the grid focus moves beyond the first row (probably to the grouped record) and hence no focus is shown.
My requirement is that the selection focus remain on the first record, even if user tries to go beyond 1st record.
To achieve this, I added the following code to the listgrid:keydownhandler after downloading the showcase sample http://www.smartclient.com/smartgwt/showcase/#grid_grouping_modes
But this didn't achieve what I wanted, and the behavior is the same.
I also tried overriding the bodykeypresshandler for listgrid
This also didn't work.
Thanks to anyone pointing out to me a way of achieving this.
@isomorphic,
This can be simulated by the showcase example cited above.
Thanks in advance for all the help.
Ravindra
HI,
1. I am using SmartGWT version as below:
SmartClient Version: v8.3p_2013-01-12/LGPL Development Only (built 2013-01-12)
2. Browser is firefox 12.0 (Mozilla firefox for Ubuntu)
Requirement:
I am using a ListGrid, which is grouped by one of the fields. (I am using the showcase example http://www.smartclient.com/smartgwt/showcase/#grid_grouping_modes, which is grouped by hemisphere).
If the selection focus on the 1st row of a grouped listgrid, and up arrow is pressed again, I want the focus to still remain in ths first row. But the default behavior seems to be that the grid focus moves beyond the first row (probably to the grouped record) and hence no focus is shown.
My requirement is that the selection focus remain on the first record, even if user tries to go beyond 1st record.
To achieve this, I added the following code to the listgrid:keydownhandler after downloading the showcase sample http://www.smartclient.com/smartgwt/showcase/#grid_grouping_modes
Code:
countryGrid.addKeyDownHandler(new KeyDownHandler() { @Override public void onKeyDown(KeyDownEvent event) { GWT.log("Key down:" + EventHandler.getKey()); final String key = EventHandler.getKey(); Integer row = countryGrid.getFocusRow(); if ((row=countryGrid.getFocusRow())==1 && key.equals("Arrow_Up")) countryGrid.selectRecord(row); } });
I also tried overriding the bodykeypresshandler for listgrid
Code:
countryGrid.addBodyKeyPressHandler(new BodyKeyPressHandler() { @Override public void onBodyKeyPress(BodyKeyPressEvent event) { final String key = EventHandler.getKey(); Integer row = countryGrid.getFocusRow(); if ((row=countryGrid.getFocusRow())==1 && key.equals("Arrow_Up")) countryGrid.selectRecord(row); } });
Thanks to anyone pointing out to me a way of achieving this.
@isomorphic,
This can be simulated by the showcase example cited above.
Thanks in advance for all the help.
Ravindra
Comment