PDA

View Full Version : store.collect on column returning nothing



shankar8rajah1
23 Oct 2013, 1:01 PM
var store = Ext.create('Ext.data.JsonStore', {
// store configs
autoDestroy: true,
//autoLoad: true,

proxy: {
type: 'ajax',
url: 'http://'+octopusPath + '/capacity/capacity_tool_discoverer/',
reader: {
type: 'json',
root: 'data',
idProperty: 'id',
totalProperty: 'total'
}
},

remoteSort: false,
sortInfo: {
field: 'name',
direction: 'ASC'
},
//pageSize: 10,
storeId: 'myStore',

fields: [
{ name: 'name' },
{ name: 'service_group' },
{ name: 'azul_zvm_version' },
{ name: 'azul_zst_version' },
{ name: 'host_tech' },
{ name: 'ait_num' },
{ name: 'app_name' },
{ name: 'data_center' },
{ name: 'instances' },
{ name: 'env' }
]
});

I have the store above which I use to get the values which works fine.

Then I use store.collect to fill the filters options:


var filters = {
ftype: 'filters',
// encode and local configuration options defined previously for easier reuse
encode: encode, // json encode the filter query
local: local, // defaults to false (remote filtering)
filters: [{
type: 'list',
dataIndex: 'name',
options: store.collect('name')
}, {
type: 'list',
dataIndex: 'service_group',
options: store.collect('service_group')
}, {
type: 'list',
dataIndex: 'app_name',
options: store.collect('app_name')
}
, {
type: 'list',
dataIndex: 'env',
options: store.collect('env')
}]
};

but all the options are empty? The grid is getting populated with all the values with no errors. Am I missing something here?