Announcement

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

    setRecordEnabledProperty disables expansion

    Hi,

    I have a grid with
    - grouping on by default
    - Checkbox SelectionAppearance
    - Simple SelectionType
    - canExpand records
    - recordEnabled/disabled


    When one record becomes selected, it can select other records which then become disabled. Users cannot unselect it, and it shows the row in disabled style.
    That's all good.

    Some records can be expanded to show some more information about it (using getExpansionComponent APIs here). When a row is disabled however, the expansion button doesn't do anything when clicking it.
    So is this click also included in the expected behavior of 'nor will it respond to mouse clicks':

    com.smartgwt.client.widgets.grid.ListGrid.setRecordEnabledProperty(String) :

    Setting this property on a record will effect the visual style and interactivity of the record. If set to false the record (row in a com.smartgwt.client.widgets.grid.ListGrid or com.smartgwt.client.widgets.tree.TreeGrid) will not highlight when the mouse moves over it, nor will it respond to mouse clicks.
    or does the click here was supposed to only ignore 'click to select' - as that would have been the excellent behavior for my case here.

    Would there still be a chance to use the built in 'disabled record property' and a way to open the expansion when a click on that button occurs?


    v8.3d_2012-11-11/Pro Deployment (built 2012-11-11)

    thanks,
    Last edited by levi; 15 Nov 2012, 02:11.

    #2
    The docs for setRecordEnabledProperty mean what they say - being disabled means that clicks in general are ignored, not just selection.

    If you need this special disabled-but-not-really mode, you can avoid marking the record as disabled, then use the general purpose styling and event APIs to replicate the aspects of being "disabled" that you actually want.

    Comment


      #3
      Hi,
      1) could you give a pointer on how to get the disabled look of the built in checkbox column in a grid, without using setRecordEnabledProperty? I'm going to try disabling my records manually, so the built in expand control still works on a disabled row.



      2) I also noticed that in FireFox 4.0.1 on a grid having an expandable row + checkbox style, clicking anywhere on the line (including on the checkbox) does not select it, but expands the row instead. So I cannot select the checkbox anymore. Compiled mode & dev mode both behave that way.

      v8.3d_2012-11-11/Pro Deployment (built 2012-11-11) was working OK for FF4.0.1
      v8.3p_2012-11-22/Pro Deployment (built 2012-11-22) NOK for FF4.0.1
      v8.3p_2012-11-30/Pro Deployment (built 2012-11-30) NOK for FF4.0.1, OK for Chrome & IE9 & FF11: only clicking the expand arrow expands the record.

      Can you check if something between the 11th and 22nd could have caused this problem? Strange that it only affects my FF4.


      thanks,

      Comment


        #4
        1. use an override of getBaseStyle() to create a distinct style series for these cells, then make all the styles in that series similar to the default disabled styles from the skin.

        2. will check on this

        Comment


          #5
          I'm stuck on the built in checkbox field.
          Code:
                  if(record&&record[this.recordEnabledProperty]==false){
                      icon=icon.replace(".","_Disabled.");
                  }
          I'm not sure how I can mimick this piece of code.
          To recap: the goal here is that users need to see that they cannot select/unselect some rows, but still see if the system selected/unselected the row for them (so I cannot use canSelectRecord property to make a row look disabled, as that would show a blank checkbox).
          And if the row has additional info, the expansion button should still be clickable and the hover should still work.


          * I also noticed, that when I use the previous solution of using a recordEnabledProperty, the style of a selected and deselected row is always "tallCellDisabled".
          When I remove the recordEnabledProperty and go with the override of getBaseStyle(), the grid is looking for "tallCellDisabledSelected" for selected rows. Fine, I can add that style myself, but it's a strange surprise that using the recordEnabledProperty, that style is not called for selected rows.

          Comment


            #6
            At this point your needs have drifted pretty far from the built-in selection and disabled behaviors.

            Probably the best thing is to implement your own type:"boolean" ListGridField to represent your own notion of selection. Then you can output whatever icons you want using a CellFormatter, and you can use whatever logic you want as far as whether other rows should be selectable.

            Comment


              #7
              Also, about the Firefox 4 problem, we couldn't reproduce it using a modified version of the Showcase sample (Expanding Rows -> Details) with checkbox selection enabled.

              It seems like perhaps you've added some additional event handling code that we don't have. Please let us know if you can isolate this to something we can run to see the issue.

              Comment

              Working...
              X