Announcement

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

    CellClickHandler breaking ListGrid grouping

    Hi all,

    I have noticed that when you add a CellClickHandler to a ListGrid and group by a field, you are unable to expand + contract the groups.

    This can be seen at

    http://www.smartclient.com/smartgwt/showcase/#grid_interaction_cell_click

    I am using GWT 1.7 and the lastest SmartGWT build. Issue is noted in Chrome 2, IE8 and Firefox 3.5.

    Regards,
    Ben

    #2
    I have noticed the issue using IE 7.0. I would appreciate very much any feedback.

    Regards,
    Brieuc

    Comment


      #3
      Please file an issue in tracker for this.

      Comment


        #4
        I have reported the bug at:

        http://code.google.com/p/smartgwt/issues/detail?id=300

        Please let me know if you need me to post a code snippet there or if the link to the showcase it adequate.

        Kind regards,
        Ben

        Comment


          #5
          The link is fine.

          Comment


            #6
            The sample was casting the record to CountryRecord in the event handler since the sample is using local data. Issue is that when in grouped mode, clicking the (+) / (-) fires the cell click listener but there is no CountryRecord corresponding to the cell. The sample has been updated the sample to work with ListGridRecord's instead. In your application you can add checks before casting to the concrete Record type if you prefer.

            Comment


              #7
              Thank you for your help, I found the workaround you have suggested to be quite easy!

              This is the code snippet I used, I hope someone else might find this useful:

              Code:
              grid.addCellClickHandler(new CellClickHandler() {  
              
              	public void onCellClick(CellClickEvent event) {
              		//Add this IF block as a workaround
              		if (event.getRecord() instanceof CustomRecord) {
              		...
              		}
              	}
              }
              Where CustomRecord extends ListGridRecord.

              Thank you again to Isomorphic and Sanjiv.

              Regards,
              Ben

              Comment


                #8
                Hi,

                I am facing the same issue but my problem is that I do not have a custom record.

                I am using the regular ListGridRecord in my ListGrid.

                Is there a way that fixes this?

                Also, in the current online showcase, when grouping and then clicking on the +/- icon, nothing happens.

                Thank you.

                Comment


                  #9
                  Did you read the previous response?

                  Originally posted by smartgwt.dev
                  The sample was casting the record to CountryRecord in the event handler since the sample is using local data. Issue is that when in grouped mode, clicking the (+) / (-) fires the cell click listener but there is no CountryRecord corresponding to the cell. The sample has been updated the sample to work with ListGridRecord's instead. In your application you can add checks before casting to the concrete Record type if you prefer.
                  Post a standalone testcase if you're having issues.

                  Comment

                  Working...
                  X