Announcement

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

    Missing ClickHandler Event on Tree/List Grid

    Hello everybody

    i'm just faciing a really strange behaviour.

    I'm using ListGrids and TreeGrids in my SmartGWT App.

    this way i register a click listener:
    grid.addClickHandler(new ClickHandler() {
    public void onClick(ClickEvent event) {
    SC.say("hello");
    }
    });

    the thing is, the click event does not happen any more, yesterday everything was working fine, the single click event was there and the method onClick executed
    but however it does not work any more, i actually checked everything i've changed so far...
    the thing is, if i click on the header of tree/list grid, the click event is there, or if i click on the border of the grid, or on any existing items, but if there are no items, and i click in the moddle of the component, no click event is fired

    spent too much time solving too foolish issue :-(
    please help

    #2
    interesting point is, if i register a double click handler like this

    grid.addDoubleClickHandler(new DoubleClickHandler() {
    public void onDoubleClick(DoubleClickEvent event) {
    SC.say("double click");
    }
    });

    the event is fired regardless where i click: in the middle, on the header on any items... it works
    but i need a working single click event...



    additionally in the developer console i see a log entry:
    17:00:08.942:MUP8:DEBUG:EventHandler:Bubbling for event 'click' cancelled via false return value by target: [TreeGridBody ID:isc_Window$PartsTreeGrid_1_body]

    something is going wrong here... but what? :-)
    Last edited by a.reiter; 17 Jun 2010, 07:12.

    Comment


      #3
      Probably being supressed by other code you have. If it was working prior, then go back to the working version and piece by piece add the new code and test till you find which is causing the issue.

      Comment


        #4
        hi Svjard

        thanks for the advice, actually this is the way, how i would fix such an issue
        unfortunatelly i did not commit the stuff to svn
        like i said, i tried everything to change back, but nothing helped

        the click event does not happen
        what is about the log entry
        17:00:08.942:MUP8:DEBUG:EventHandler:Bubbling for event 'click' cancelled via false return value by target: [TreeGridBody ID:isc_Window$PartsTreeGrid_1_body]
        i guess the warning comes from the EventHandler.js, but why is the event cancelled?

        Comment


          #5
          Well the message is pretty clear, the tree body returned false which is the same as event.cancel(). Probably remove all handlers associated with your tree to start with.

          Comment


            #6
            out of ideas... :-(

            there must be something with my environment and nothing with the actual TreeGrid

            i just created a new little TreeGrid and replaced all my components with it, so nothinig is drawn except the TreeGrid

            TreeGrid tg = new TreeGrid();
            tg.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
            SC.say("click on tree grid");
            }
            });
            tg.draw();


            and still... the click is working, if i click on the header, but not if i click in the middle
            there are no handlers associated with the tree, so which body returns false? who cancels the event?

            still the same log entry:

            08:53:32.864:MUP5:DEBUG:EventHandler:Bubbling for event 'click' cancelled via false return value by target: [TreeGridBody ID:isc_TreeGrid_1_body]

            Comment


              #7
              Can you post a minimal standalone test case you have? I can't reproduce it, and it is fundamental to most showcase examples.

              Comment

              Working...
              X