I've been struggl开发者_如何学运维ing with this for quite a while now. The dataProvider for my grid contains several objects. Some of which have a Number value, and some Boolean values under field 'value' (other fields are used in other columns).
I would like to be able to render differently for each data-type, i.e. have a checkBox for booleans, and a label for numbers. Furthermore, I would like to be able to edit these fields differently, unchecking the checkbox for booleans, and using a numericStepper for Numbers.
Any suggestions?
Just FYI, I decided to go with AdvancedDataGrid, to take advantage of the styleFunction property, nothing more..
Tried to used spark-states, which didn't seem to work as I'm using an AdvancedDataGrid. I'm not sure what the problem was.
You can implement this behavior using ItemRenderes and ItemEditors.
you can render out a checkbox if the type of the value is Boolean, and if it's something else you can render out a textInput.
精彩评论