 class CheckBox extends Lanes.React.BaseComponent
     d: -> @props.query.results.xtraData(@props.row)
 
-    onChange: (ev) -> #, me, results, index) ->
+    onChange: (ev) ->
         @d().selected = ev.target.checked
         @props.selections.onChange?(@props)
         @forceUpdate()

    onColumnClick: (ev, props) ->
        unless ev.target.tagName is 'INPUT'
            input = ev.target.querySelector('input')
            xd = props.query.results.xtraData(props.rowNum)
            xd.selected = input.checked = !input.checked
        @onChange?(props)
        ev.stopPropagation()


        false == this.xtraData(indx)?.selected

class Lanes.Components.Grid.Selections

    @setRow: (row, xd, selected) ->
        xd.selected = selected

    @isSelected: (row, xd, selected) ->
        !(xd && false == xd.selected)


    constructor: (options = {}) ->
        _.extend(@, DEFAULTS)
        _.extend(@, _.pick(options, 'onChange', 'attributesGetter'))
        @choices = {}
        _.bindAll(@, 'onColumnClick')
        @component = _.partial(@component, _, @)
