Sha256: ff218f0d10d0a031683b1d1e4820ac27cd393cf4a2131f7f390497fb6d6ff6c3

Contents?: true

Size: 1.7 KB

Versions: 3

Compression:

Stored size: 1.7 KB

Contents

Ext.define('FastUI.view.DataFieldFactory', {
    singleton: true,

    buildField:function(fields, field){
        switch (field.datatype) {
            case 'VTree':
                fields.push({
                    name: field.name.replace('_id', ''),
                    type: 'auto'
                });
                break;

            case 'VTable':
                fields.push({
                    name: field.name.replace('_id', ''),
                    type: 'auto'
                });
                break;

            case 'VLookup':
                fields.push({
                    name: field.name.replace('_id', ''),
                    type: 'auto'
                });
                break;

            case 'VSingleChoice':
                fields.push({
                    name: field.name.replace('_id', ''),
                    type: 'auto'
                });
                break;

            case 'VList':
                fields.push({
                    name: field.name.replace('_id', ''),
                    type: 'auto'
                });
                break;

            case 'VGroup':
                Ext.each(field.members, function(member){
                    this.buildField(fields,member);
                },this);
                break;


            default:
                if(Array.isArray(field)){
                    Ext.each(field, function(f){
                        this.buildField(fields,f);
                    },this);
                }else{
                    fields.push({
                        name: field.name,
                        type: 'auto'
                    });
                }
        }
    }
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fastui-0.1.8 app/assets/javascripts/fastui/app/view/DataFieldFactory.js
fastui-0.1.7 app/assets/javascripts/fastui/app/view/DataFieldFactory.js
fastui-0.1.6 app/assets/javascripts/fastui/app/view/DataFieldFactory.js