user594979
user594979

Reputation: 115

flex : add checkbox to datagrid control


i have a datagrid in my flex application, i am binding datagrid with arrayCollection, now i want to add checkbox control to datagrid column and i dont want to bind chekcbox to arraycollection values. i want something like this without binding checkbox column field with arryayCollection.

Upvotes: 0

Views: 1324

Answers (1)

VikramAdith
VikramAdith

Reputation: 21

Write an itemRenderer which is a checkBox, and handle change event. On change, set a property in the data to the selected boolean. Ex: data.rowIsSelected = checkBox.selected; The property does not need to already exist in the dataProvider.

Override set data property, and specify the check box's selected property to be the same as data.isRowSelected.

Later on, you can loop through the data set and get each item in the dataProvider's isRowSelected property to see if user had selected it or not.

Upvotes: 1

Related Questions