Announcement

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

    DoubleClick and SingleClick action needs to be handled.

    java: 1.8
    GWT: 2.7.0
    SmartGWT: 5.0-p20150816

    I have a TreeGrid with many columns.

    I need to allow a user to use single click to select a "row" and double click to initiate an action ( popping up another window ).
    We have a "+" being used to click on for opening nodes, so double click does not need to open nodes.

    I have tried a number of different handlers, RecordClickHandler, RecordDoubleClickHandler, CellContextClickHandler, CellClickHandler, CellDoubleClickHandler.
    None will allow me to catch the double click once I have a (single) click Handler.

    Please tell me what I need to do the have the behavior that I want.

    Please also remember this is a TreeGrid not a simple ListGrid.



    #2
    The most common cause for this is that you are performing a DataSource request as a result of the first click. This will block the UI for the duration of the request by default, which will stop any second click from triggering the doubleClick event. To avoid this, use rpcRequest.showPrompt:false, which can be set via the requestProperties argument of most calls that trigger dsRequests.

    Comment


      #3
      Well, we do not do bind a datasource to the TreeGrid. We do a fetch using the datasource which is not bound to any widget and in the callback populate the TreeGrid with data.
      The Tree is populated, the data completed loaded in our callback.

      The treeGrid is rendered and has all the data. The user needs to be able to select on single record and double click initiates a window opening.
      Your response is directed to a scenario that is not what we have.

      Comment


        #4
        It doesn't matter whether the TreeGrid is databound, what matters is whether a fetch is initiated in response to the first click.

        If you don't know, it's easy to find out using the RPC tab of the Developer Console.

        If you think we're wrong about the cause, try adding click and doubleClick handlers to any framework sample, where the handlers do nothing but log a message to the console. This should show you the event fires as expected, then you can return to your application code and try to narrow down how you've broken the normal behavior.

        Comment


          #5
          "It doesn't matter whether the TreeGrid is databound, what matters is whether a fetch is initiated in response to the first click."

          There is no fetch for any click.

          As I said earlier, the grid is already *populated*, *showing the data*, and *rendered* to the user. Our fetch has completed because we call the datasource directly and passed a callback to the fetch.
          In the callback the returned data is set on the grid. The user interacts with other portions of the screen and by the time the user gets to interact with the grid at least 30 secs has lapse from the time of the fetch.

          As I said earlier:
          "I have tried a number of different handlers, RecordClickHandler, RecordDoubleClickHandler, CellContextClickHandler, CellClickHandler, CellDoubleClickHandler.
          None will allow me to catch the double click once I have a (single) click Handler."

          Given what I have told you, your answer makes absolutely no sense to me. When the click occurs, the grid has completely rendered showing all data. Nothing at the time of the click has anything to do with the RPC.

          Comment


            #6
            Please read more closely: we are not saying that there is a fetch related to the TreeGrid loading it's data, we are suggesting that there is *some other, unrelated fetch or other RPC* that you are triggering on the click.

            If you have not yet checked the RPC tab as previously suggested, please do so now.

            Regardless of whether you find an RPC or not, our previous post also explains your next actions after this.

            Comment

            Working...
            X