Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: Extjs 6 combobox「queryMode: 'local'」 data not showing

dummy:

So I have a combobox that is loaded dynamically for a certain view. Whenever I put the queryMode to remote, it would load the data if I clicked the combobox, but if set to local it won't show any data. Am I missing something here?

Hope someone can help me.

This is my controller for the view with the combobox:


Ext.define('Stm.controller.HpUpdate', {
extend: 'Ext.app.Controller',

requires: [
'Stm.view.contents.hpupd.Detail'
],

stores: [
'SiteDomain'
],

fromDetail: false,
isAbort: false,
isDataSeted: false,
firstSorters: undefined,
recordId: undefined,
isUpdate: false,

init: function() {
this.callParent(arguments);
console.log(Ext.getDisplayName(arguments.callee));

this.control({
'hup-list': {
afterRender: this.setupStmList
}
});

this.addRef([{
ref: 'list',
selector: 'hup-list'
},
{
ref: 'detail',
selector: 'hup-detail'
},
]);
},

setupStmList: function() {
console.log(Ext.getDisplayName(arguments.callee));

var me = this;
var store = me.getSiteDomainStore();
var record = Cps.Util.baseRecord();

store.load({
params: param,
callback: function(records, operation, success) {
var response = operation.response;
if (!response || response.length === 0) {
return;
}

var responseText = response.responseText;
if (!responseText || responseText.length === 0) {
return;
}
var res = Ext.decode(responseText);

if (res.common.st === 'mainte' || res.common.st === 'abort') {
return;
}

if (res.common.st === 'ng') {
Cps.Util.alert(res.common.msg);
return;
}
if (records.length === 0) {
return;
}

me.getList().down('#dtAplDateTimeFrom').down('#dateField').focus();
}
});

me.firstSorters = this.getHpUpdateStore().getSorters();
},
});

This is my view:


Ext.define('Stm.view.contents.hpupd.List', {
extend: 'Ext.container.Container',
alias: 'widget.hup-list',
layout: {
type: 'vbox',
align: 'stretch'
},

items: [{
xtype: 'cps-combobox',
fieldLabel: 'Domain',
itemId: 'cmbSiteDomain',
queryMode: 'local',
store: {
type: 'sitedomain'
},
width: 350,
displayField: 'siteDomain',
valueField: 'siteId',
}],
});

Store:


Ext.define('Stm.store.SiteDomain', {
extend: 'Extends.data.Store',
alias: 'store.sitedomain',
requires: [
'Cps.Setting',
'Stm.model.SiteInfo'
],

model: 'Stm.model.SiteInfo',

pageSize: Stm.Const.controller.dataCountLimit,
proxy: {
type: 'ajax',
url: Cps.Setting.getEntryUrl() + '/stm/st-update/site-domain',
reader: {
type: 'json',
rootProperty: 'data'
},
actionMethods: {
create: 'POST',
read: 'POST',
update: 'POST',
destroy: 'POST'
}
}
});



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: Extjs 6 combobox「queryMode: 'local'」 data not showing

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×