Announcement

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

    Question about setRecordEnabledProperty

    Hi, while playing around with ListGrid I discovered a behavior that I couldn't wrap my head around.

    The method grid.setRecordEnabledProperty() is used to determine if a record is enabled or not.

    Say you have an attribute called banana, and you set that in the method. If a record has banana=false, the row will display as disabled and cannot be interacted with.

    I thought I wanted to turn that feature off, i.e. all records are enabled, always.

    So, I called that method with null. What happened is that no records are displayed in the disabled style, but no row can be selected or clicked on! The only trigger is that there is a hover change to row color.

    Is this intended behavior? I guess I could set that value to an attribute that doesn't exist in the record, it seems to work, but can you turn the feature off? Cheers

    #2
    The framework definitely is not expecting the recordEnabledProperty to be set to null. You should just set it to an unknown property.

    As far as why you're getting the result you are, if you were to do it in JavaScript, basically the framework would still be checking for values for the recordEnabledProperty, but under a property named "null" (as in the String "null"). That would generally work, but you definitely haven't turned off the concept of records being enabled and disabled (which cannot be turned off), you've just chosen a weird property name for storing the enable/disable state.

    We're not sure why it behaves more oddly with GWT involved - perhaps GWT is using the "null" property for something - but it's not worth chasing, as null is not allowed here anyway.

    Comment

    Working...
    X