rxbass
17 Oct 2012, 11:18 PM
I need to load db values to a combo box for multi selection. I can't figure out, why values are not loading into combo box. By firebug, console.log values are printed out. Here is my code for multiselect combo box,
var groups = new Ext.data.JsonStore({
fields: [
{ id: 'id' },
{ name: 'name' }
],
root: 'rows',
autoDestroy: true,
autoLoad: true,
proxy: new Ext.data.HttpProxy({
url : GO.settings.modules.schedule.url + 'groups.php',
}),
reader: {
type: 'json',
root: 'rows'
},
listeners: {
load: function(obj, records){
Ext.each(records, function(rec){
console.log(rec.get('name')); }); } } }); var taskGroup = new Ext.form.ComboBox({
name : 'Group',
hiddenName : 'group',
triggerAction : 'all',
editable : false,
fieldLabel : 'Group',
mode : 'local',
autoLoad: true,
displayField : 'text',
store : groups,
columns: [ { dataIndex: 'name' } ], });
var groups = new Ext.data.JsonStore({
fields: [
{ id: 'id' },
{ name: 'name' }
],
root: 'rows',
autoDestroy: true,
autoLoad: true,
proxy: new Ext.data.HttpProxy({
url : GO.settings.modules.schedule.url + 'groups.php',
}),
reader: {
type: 'json',
root: 'rows'
},
listeners: {
load: function(obj, records){
Ext.each(records, function(rec){
console.log(rec.get('name')); }); } } }); var taskGroup = new Ext.form.ComboBox({
name : 'Group',
hiddenName : 'group',
triggerAction : 'all',
editable : false,
fieldLabel : 'Group',
mode : 'local',
autoLoad: true,
displayField : 'text',
store : groups,
columns: [ { dataIndex: 'name' } ], });