Ext.define("App.view.UserCombo", {
    extend: "Ext.form.field.ComboBox",
    alias: "widget.userCombo",

    fieldLabel: App.localeRes("User"),
    name: "userId",
    selectOnFocus: true,
    forceSelection: true,
    valueField: "id",
    displayField: "fullname",
    queryMode: "remote",
    typeAhead: true,
    tpl:
        '<tpl for="."><div class="x-boundlist-item">{fullname}</div></tpl>',
    displayTpl: '<tpl for=".">{fullname}</tpl>',
    params: {},

    initComponent: function() {
        var me = this;
        if (!me.store)
            me.store = Ext.create("App.store.UserComboStore", {
                extraParams: me.params
            });

        me.callParent();
    }
});
