Announcement

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

    how to get Event on checkbox in treeGrid??

    hi All!!

    can be please tell me how i can get event on checkbox on TreeGrid..
    i.e if i click on checkbox corresponding to a node in a treegrid ..then how can i get value change event??
    so that i can maintain the list of checkbox selected..??

    please reply..
    thnx!

    #2
    TreeGrid.addRecordClickHandler() make sure to call super.onRecordClick(event) though as well.

    Comment


      #3
      this recordClickHander() is called when a node is clicked..
      its is not called when a checkbox corresponding to a node is clicked..
      i want the event on click of checkbox.
      have used selectionAppearence for the checkbox!

      Comment


        #4
        Well the record includes the checkbox you just have to do more work, the only other way is to addSelectionChangedHandler()

        Comment


          #5
          In TreeGrid or ListGrid there is no addSelectionChangedHandler()..!
          now?

          Comment


            #6
            So this is the last reply I'll give but literally take this example
            http://www.smartclient.com/smartgwt/showcase/#tree_checkbox
            and add this code to it
            Code:
            employeeTreeGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
              @Override
              public void onSelectionChanged(SelectionEvent event) {
                SC.say("I clicked the checkbox");
              }
            });
            if it doesn't work it is an issue on your own end and you need to figure it out.

            Comment


              #7
              hey thanx..its working..
              There is 1 more problem..

              when i set the tree data,at that time i want some of the checkbox to be selected(checked)..
              is there any solution for this?

              Comment


                #8
                Originally posted by Roma Singhal
                hey thanx..its working..
                There is 1 more problem..

                when i set the tree data,at that time i want some of the checkbox to be selected(checked)..
                is there any solution for this?
                I think you can use
                Code:
                public void onDataArrived(DataArrivedEvent event)
                {
                	setSelectedState(" .... ");
                }

                Comment


                  #9
                  First read: http://forums.smartclient.com/showthread.php?t=11423

                  You'll need the latest build at http://www.smartclient.com/builds/smartgwt/

                  Comment

                  Working...
                  X