Commit 9a150e5c authored by Guanji Wang's avatar Guanji Wang
Browse files

Fix the datasetlink bug for showing only first 25 datasets

parent 34edb9e2
Loading
Loading
Loading
Loading
Loading
+29 −4
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ Ext.define('sitools.admin.datasets.columnRenderer.DatasetLinkPanel', {
        
        var storeDatasets = Ext.create('Ext.data.JsonStore', {
            autoLoad : true,
            pageSize: 10,
            proxy : {
                type : 'ajax',
                url : this.urlDatasets,
@@ -112,6 +113,7 @@ Ext.define('sitools.admin.datasets.columnRenderer.DatasetLinkPanel', {
        });
        
        this.comboDatasets = Ext.create('Ext.form.ComboBox', {
            width: 330,
            store : storeDatasets,
            name : "comboDatasets",
            displayField : 'name',
@@ -119,14 +121,37 @@ Ext.define('sitools.admin.datasets.columnRenderer.DatasetLinkPanel', {
            typeAhead : true,
            queryMode : 'local',
            forceSelection : true,
            triggerAction : 'all',
            triggerAction : 'query',
            minChars: 0,
            emptyText : i18n.get("label.selectADataset"),
            selectOnFocus : true,
            anchor : "100%",
            //anchor : "200%",
            fieldLabel : i18n.get('label.dataset'),
            labelWidth : 60,
            allowBlank : false,
            pageSize: true,
            listeners : {
                scope : this,
                render: function (combo) {
                    combo.triggerEl.on('click', function () {
                        if (!Ext.isEmpty(combo.getValue())) {
                            var record = combo.getStore().getById(combo.getValue());
                            if (!Ext.isEmpty(combo.tmpValue)) {
                                if (combo.tmpValue.get('id') != combo.getValue()) {
                                    combo.tmpValue = record;
                                }
                            } else {
                                combo.tmpValue = record;
                            }
                        }
                        combo.clearValue();
                    }, combo);
                },
                blur: function (combo) {
                    if (Ext.isEmpty(combo.getValue())) {
                        combo.setValue(combo.tmpValue);
                    }
                },
                select : function (combo, recs, index) {
                    var id;
                    if (Ext.isArray(recs)) {