Announcement

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

    Navigating with keyboard in ListGrid's column header

    Hello,
    I'm using SmartGWT 3.1 and I'd like to know if there's a way to navigate in the column headers. In particular open the menu and hide/show columns, sort content etc.
    Will I have to create a specific listener?

    Thanks,
    Cédric.

    #2
    If you set canTabToHeader you should be able to tab into the ListGrid header buttons.

    At this stage you can change the header button via left and right arrow keys.
    At this point you have normal widget interaction on the focussed button - so you'll get sorting via Spacebar or Enter keypress (simulating a click on the button). The menu can be displayed via a context click (right-click) - the keyboard shortcut for this action is determined at the OS level: Windows offers an assigned key on some keyboards, and an equivalent key combo [shift+f10, I believe].

    Comment


      #3
      I didn't see this property. It's working great, to open the menu I've used the standard windows Key. Is there a way to change this key binding?

      Comment


        #4
        It's not entirely straightforward to change the key that launches the context-menu.
        To do this you would need to add an explicit keyPress handler to the listGrid header button, look at what key was pressed, and if necessary trip the event.
        You could use ListGridField.setHeaderButtonProperties() to customize the automatically generated header button and include this keypress handler.
        You'd want to call 'getHeaderContextMenuItems()' to grab the set of items to display, and assign them to a menu and show it.
        Note that you'd also want to avoid creating a new Menu every time the method was run, so you'd probably want to cache this object.

        Regards
        Isomorphic Software

        Comment

        Working...
        X