Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to (re)set focus in ListGrid or TreeGrid?

    If the user tabs into a ListGrid or TreeGrid and performs a selection with cursor keys, that focus position is remembered internally. So when the user tabs out and in again, the cursor focus remains at the previous position. So far so good.

    However if the data of the Grid has changed this behavior is confusing. Assume a search dialog with a hitlist as ListGrid. If the search criteria have changed and the search was performed again the hitlist gets populated with totally different data. There is no reason why the focus should still be at position say 7 when I tab into the hitlist. Note: If the new data has less rows (e.g. < 7) then the focus position is reset to 0.

    Hence, I am looking for a way (API method) to (re)set the focus but cannot find any.
    I found ListGrid.getFocusRow() but in my tests it always returned null and there is also no setFocusRow where I could pass 0.

    Does anybody have a hint for me how to solve this problem without dumping the ListGrid and creating a new one whenever the data has changed?

    You want to reproduce what I am talking about?

    0. Unplug your mouse :)

    1. Go here:
    http://www.smartclient.com/smartgwt/...nce_empty_grid

    2. Tab into the list (Tab order is somewhat confusing here) and select something other than the first row using arrow down key.

    3. Tab out to the buttons and perform "Clear Data" and then "Set Data".

    4. Tab back into the ListGrid (and assume the data would now be something totally different).
    You will see that the position from step 2. is still focused.
    Last edited by hohwille; 27 Feb 2013, 01:42.

    #2
    Bug is still there

    I can still find this bug on Version:
    Isomorphic SmartClient, Version v9.0_2013-07-03 (2013-07-03)
    and JAWS 13.0, FF 10.0.3 and SC.setScreenReaderMode(true);

    Could you please fix this bug?

    Regards
    Magda

    Comment


      #3
      Hello,

      I encountered the same problem: I'd like to reset the focus position in a ListGrid after the grid data has been changed.

      I'm using Smart GWT Power Edition 4.0 [v9.0p_2013-08-29/PowerEdition Deployment (built 2013-08-29)]

      Could you please provide any feedback on this issue? Thank you very much.

      Comment

      Working...
      X