Sha256: 3a4b25b2ddc909cca6ccab46059bbeff9e4a22e4b7d90f61d7121ecac46c7671

Contents?: true

Size: 1.32 KB

Versions: 1

Compression:

Stored size: 1.32 KB

Contents

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

    triggerCls: Ext.baseCSSPrefix + 'form-search-trigger',
    editable:false,
    displayField:'title',
    valueField:'id',
    initComponent:function () {
        this.fieldLabel = this.getFValue('title');
        this.name =  this.rest.getTableName() + '[' + this.getFValue('name') + ']';
        this.disabled = this.getFValue('readonly');
        this.allowBlank = true;
        this.store = Ext.create('Ext.data.ArrayStore', {
            fields:['id', 'title'],
            data:[]
        });
        this.callParent();
    },
    getDefaultValue: function(){
        return this.getFValue('default_logic');
    },
    getFValue:function (key) {
        return this.valueObject[key];
    },
    setValue:function(value){
        if(value && value.id && value.title){
            this.store.add(value);
            this.setValue(value.id);
        }else{
            this.callParent(arguments);
        }
    },

    onTriggerClick:function () {
        this.loadWindow();
    },
    loadWindow:function () {
        this.window = Ext.create('FastUI.view.VSearchWindow',{vlookup:this});
        this.window.show();
    }
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fastui-0.1.3 app/assets/javascripts/fastui/app/view/vfield/VLookup.js