Sha256: 68e196573ec6ec35ada47f5d4f970911a6dd0c129b0e4bffe6892c8bb1953388

Contents?: true

Size: 1.19 KB

Versions: 7

Compression:

Stored size: 1.19 KB

Contents

class Lanes.Components.Grid.Editor extends Lanes.React.BaseComponent

    propTypes:
        onCancel: React.PropTypes.func.isRequired

    getInitialState: ->
        selectedModel: false

    onEditCancel: (model) ->
        @props.onCancel(model)

    onEditSave: (model, isDeleted = false) ->
        if (isDeleted)
            @props.query.results.removeRow(@props.editing.index)
        else
            @props.query.results.saveModelChanges(model, @props.editing.index)
        @props.onSave()

    render: ->
        return null unless @props.editing
        Editor = if true == @props.editor
            Lanes.Components.Grid.RowEditor
        else
            @props.editor
        <Editor
            {...@props.editing}
            {...@props.editorProps}
            query       = {@props.query}
            model       = {@props.editing.model}
            onCancel    = {@onEditCancel}
            onSave      = {@onEditSave}
            cellStyles  = {@props.cellStyles}
            editors     = {@props.columEditors}
            rowIndex    = {@props.editing.index}
            rowHeight   = {@props.rowHeight}
            allowDelete = {@props.allowDelete and @props.commands?.isEditing()}
        />

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
lanes-0.7.0 client/lanes/components/grid/Editor.cjsx
lanes-0.6.1 client/lanes/components/grid/Editor.cjsx
lanes-0.6.0 client/lanes/components/grid/Editor.cjsx
lanes-0.5.6 client/lanes/components/grid/Editor.cjsx
lanes-0.5.5 client/lanes/components/grid/Editor.cjsx
lanes-0.5.0 client/lanes/components/grid/Editor.cjsx
lanes-0.4.0 client/lanes/components/grid/Editor.cjsx