Announcement

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

    Set focus into a listgrid

    Hello Isomorphic.

    I know how to set focus to a dynamic form but can not figure out how to set focus into a listgrid. The goal is to set focus to the grid after a search/fetch operation.

    By the way I am getting fantastic results using PHP to return JSON sesponses.

    #2
    Hi Dave,
    If you're trying to focus in the ListGrid as part of the callback from a fetch or filter operation, the problem is probably that the operation prompt is still showing when your callback fires -- and you can't focus (or otherwise interact with widgets) while the prompt is up.
    You can use delayCall() to delay your focus call and ensure it executes in a separate thread, after the prompt has been cleared.

    For example, try modifying the Showcase Application to do a delayed focus as the callback for the filter operation:
    Code:
        itemList.filterData(findValues, "itemList.delayCall('focus');");
    Let us know if this doesn't work for you

    Thanks
    Isomorphic Software

    Comment


      #3
      Thank You Isomorphic.

      I still do not understand how to set focus to a grid - say to the
      bottom row or top row with a button. (I do understand the delay
      issue.)

      mylistGrid.focus() ????

      Comment


        #4
        Hi Dave
        Yes - calling "focus()" on the listGrid gives it keyboard focus. This means that pressing up/down arrow keys on the keyboard will shift the selection within the grid (see arrowKeyAction for more on this.
        If you want to "put focus on a specific row", select the row using the listGrid.selection object APIs then call 'myListGrid.focus()' [or to workaround the delay issue 'myListGrid.delayCall("focus");']

        Comment

        Working...
        X