Sha256: c6750e8033384ad366a55fd7aa55352c64b851175a924e91d444d11e3afb7292

Contents?: true

Size: 1.35 KB

Versions: 6

Compression:

Stored size: 1.35 KB

Contents

Ext.define('FastUI.view.vfield.VMultipleChoice', {
    extend:'Ext.form.field.ComboBox',
    valueObject: {},
    winCtx:{},
    winId:0,
    rest:{},

    valueField:'id',
    displayField:"title",
    forceSelection:true,
    multiSelect: true,
    triggerAction:'all',
    editable:false,
    selectOnFocus:true,

    initComponent:function () {
        this.fieldLabel = this.getFValue('title');
        this.name =  this.rest.getTableName() + '[' + this.getFValue('m_property').name.pluralize()+'][]';
        this.disabled = this.getFValue('readonly');
        this.allowBlank = true;
        this.store = this.getStore();
        this.callParent();
    },
    getStore:function () {
        var rest = Ext.create('FastUI.view.Rest', this.getMEntity().name);
        return new Ext.data.JsonStore({
            autoLoad:{start:0, limit:2},
            fields:['id', 'title'],
            proxy:{
                type:'ajax',
                url:rest.indexPath(),
                reader:{
                    type:'json',
                    root:'rows',
                    totalProperty:"totalCount"
                }
            }
        });
    },
    getMEntity:function(){
        return this.valueObject.m_property.m_datatype.m_entity;
    },
    getFValue:function (key) {
        return this.valueObject[key];
    }
});

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fastui-0.1.8 app/assets/javascripts/fastui/app/view/vfield/VMultipleChoice.js
fastui-0.1.7 app/assets/javascripts/fastui/app/view/vfield/VMultipleChoice.js
fastui-0.1.6 app/assets/javascripts/fastui/app/view/vfield/VMultipleChoice.js
fastui-0.1.4 app/assets/javascripts/fastui/app/view/vfield/VMultipleChoice.js
fastui-0.1.3 app/assets/javascripts/fastui/app/view/vfield/VMultipleChoice.js
fastui-0.1.2 app/assets/javascripts/fastui/app/view/vfield/VMultipleChoice.js