You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I've been using the datagrid for a couple of months and i have deal with custom formatters and conditional actions.
Currently if i need to format a status column (integer), i use a custom formatter called LabelFormatter which displays the status column to a human readable status ie:
I order to add conditional values to my actions i add the status column twice, i hide the original and add a second one and add the formatter to it, then i add my showOnValue to the hidden original.
Here is my question, giving that the Formatter has a purely presentation purpose (it might not in some cases), shouldn't the showOnValue value be compared with the raw value and not with the formatted one?
This is because i shouldn't need to add the status column twice, but just once, so if i am comparing with '1', then:
1 === '<label class="open">OPEN</label>' // works only if compare is '==' as a boolean
// having 1 = the state i want to compare with
// '<label class="open">OPEN</label>' = the formatted value of column 'status'
should be:
1 === 1
// 1 = the state i want to compare with
// 1 = the raw value of column 'status'
Is this the expected behaviour or did i missed something?
Thanks.
The text was updated successfully, but these errors were encountered:
rumeau
changed the title
Should formatter keep the raw data?
Should formatter keep a reference to the raw column data?
Aug 25, 2014
Hello, I've been using the datagrid for a couple of months and i have deal with custom formatters and conditional actions.
Currently if i need to format a status column (integer), i use a custom formatter called LabelFormatter which displays the status column to a human readable status ie:
I order to add conditional values to my actions i add the status column twice, i hide the original and add a second one and add the formatter to it, then i add my showOnValue to the hidden original.
Here is my question, giving that the Formatter has a purely presentation purpose (it might not in some cases), shouldn't the showOnValue value be compared with the raw value and not with the formatted one?
This is because i shouldn't need to add the status column twice, but just once, so if i am comparing with '1', then:
should be:
Is this the expected behaviour or did i missed something?
Thanks.
The text was updated successfully, but these errors were encountered: