Sha256: 47da761b42bdcfdc90bd34641f7b6a9c72c9ce7f606d0014e8619b464b282c00

Contents?: true

Size: 1.35 KB

Versions: 3

Compression:

Stored size: 1.35 KB

Contents

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

    propTypes:
        model: Lanes.PropTypes.Model.isRequired
        label: React.PropTypes.string
        name:  React.PropTypes.string
        useFinder: React.PropTypes.bool

    getDefaultProps: ->
        label: 'Payment Terms', name: 'terms'

    dataObjects:
        query: ->
            new Lanes.Models.Query({
                syncOptions: @props.syncOptions, autoRetrieve: true
                src: Skr.Models.PaymentTerm, fields: [
                    { id:'id', visible: false}
                    { id: 'code', fixedWidth: 130 },
                    'description',
                    { id: 'days', fixedWidth: 80 }
                    { id: 'discount_days', label: 'Disc Days', fixedWidth: 80 }
                    { id: 'discount_amount', label: 'Disc Amt', fixedWidth: 80 }

                ]
            })

    render: ->
        if @props.useFinder
            <LC.RecordFinder ref="finder"
                collection={Skr.Models.PaymentTerm.all}
                commands={@props.commands}
                query={@query}
                {...@props} />
        else
            <LC.SelectField sm=3
                choices={Skr.Models.PaymentTerm.all.models}
                labelField="code"
                {...@props}
                fetchWhenOpen={false}
                model={@props.model} />

Version data entries

3 entries across 3 versions & 1 rubygems

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