Sha256: 900203f7bd660455a8f25c412179d13147710c6fd4d1326a7e68576fa9af8303

Contents?: true

Size: 1.15 KB

Versions: 2

Compression:

Stored size: 1.15 KB

Contents

class Skr.Components.BankAccountFinder extends Lanes.React.Component

    propTypes:
        model:      Lanes.PropTypes.Model
        commands:   React.PropTypes.object
        autoFocus:  React.PropTypes.bool
        name:       React.PropTypes.string
        selectField:   React.PropTypes.bool

    getDefaultProps: ->
        autoFocus: false, label: 'Bank Account', name: 'code'

    dataObjects:
        query: ->
            new Lanes.Models.Query({
                syncOptions: @props.syncOptions, autoRetrieve: true
                src: Skr.Models.BankAccount, fields: [
                    {id:'id', visible: false}
                    {id: 'code', fixedWidth: 130 },
                    {id: 'name', flex: 1}
                    {id: 'description', flex: 1.5}
                ]
            })

    render: ->
        props = _.clone(@props)

        if props.selectField
            <LC.SelectField queryModel={Skr.Models.BankAccount}
                labelField='code' sm=2 {...props} />
        else
            <LC.RecordFinder ref="finder" sm=3 autoFocus
                commands={@props.commands}
                query={@query}
                {...props} />

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stockor-0.4.0 client/skr/components/BankAccountFinder.cjsx
stockor-0.3.0 client/skr/components/BankAccountFinder.cjsx