0

I am using Ext GWT 2.2.4. In our application we are binding onClick event on Grid and making a server call to fetch data on the even of Click. We display the result on a Dialog box.

The Problem is, if user clicks on the cell more than one time, we get repeated data on the same dialog box. I have also put "getListStore().removeAll()" statement to clear the model and re-populate to show the fresh data in the dialog box.

PS. I have also tried binding Events.onDoubleClick event as well, but it doesn't solve my problem because even Double Click calls "Click - Click" two times.

Would really appreciate your help. I have been searching this forum for the solution, there are similar posts but I didn't not find any solution.

Here is the code:

 grid.addListener(Events.OnClick, new Listener<GridEvent<ModelData>>() {

       public void handleEvent(GridEvent<ModelData> be) {
            performAction(be);
       }
  });

  private void performAction (GridEvent<ModelData> be) {
            AppEvent event = new AppEvent(Events.onClick);
            dispatcher.dispatch(event);
  }
  • 1
    Is the problem that data is repeated? And did the statement "getListStore().removeAll()" solve it, or not? I cant understand what are you talking about in this question and what do you want. – hsestupin Jun 14 '12 at 13:13
  • Sorry for confusing statements, My Events.onClick 'handler' calls a service to fetch data, I noticed DoubleClick fires 3 events - "Click-Click-DoubleClick". Is it the default behavior of DoubleClick? I want to handle only Events.onClick and do not do anything on DoubleClick but unfortunatly DobleClick fires "Click" twice so I end up having two click events and hence two service calls. I managed to avoid populating grid with duplicate data by putting getListStore().removeAll inside onSuccess() method, but can I have a better approach to avoid doing same thing twice? - thanks – eatdrinkcode Jun 15 '12 at 05:17

0 Answers0