-
15 Jun 2010 12:08 PM #1
[SOLVED] ComboBox not loading data from store
[SOLVED] ComboBox not loading data from store
This has been driving me crazy and I cannot see what I am doing wrong... it's going to be some simple setting, I know it. Any help appreciated!
Code:MyComboUi = Ext.extend(Ext.form.ComboBox, { fieldLabel: 'Month/Year', anchor: '100%', store: 'MonthYearStore', valueField: 'ID', displayField: 'Text', hiddenId: 'EpisodeMonthYear', hiddenName: 'EpisodeMonthYear', mode: 'remote', forceSelection: true, initComponent: function() { MyComboUi.superclass.initComponent.call(this); } }); SDMonthYearStore = Ext.extend(Ext.data.JsonStore, { constructor: function(cfg) { cfg = cfg || {}; StormDatMonthYearStore.superclass.constructor.call(this, Ext.apply({ storeId: 'MonthYearStore', root: 'Data', idProperty: 'ID', totalProperty: 'TotalCount', autoSave: false, url: '/sd/api.svc/lookup/MonthYearData', autoLoad: true, restful: false, sortField: 'ID', sortDir: 'DESC', fields: [ { name: 'ID', type: 'string' }, { name: 'Text', type: 'string' } ] }, cfg)); } }); new SDMonthYearStore();
-
15 Jun 2010 2:46 PM #2
try setting mode to local
-
15 Jun 2010 3:00 PM #3
Thanks, j-joey! That fixes it but I'd like to understand why "local" works when in reality I am retrieving the data via ajax from a web service? When is "remote" appropriate?
-
15 Jun 2010 11:37 PM #4
hi,
as you can see in the source code ( http://www.sencha.com/deploy/dev/doc...mboBox-doQuery ), basically, mode config property tells where the filtering will be done.
if you choose remote, when you type something on combo it sets baseparams to filter and loads the store.
if you choose local, it just filters the results.
that's all...
-
16 Jun 2010 7:47 AM #5
This will take some getting used to - the ext ComboBox is a lot more powerful than a regular dropdown.
Similar Threads
-
Loading XML data into data.Store into a ComboBox
By yousefomar in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 14 Jul 2009, 11:34 AM -
Combobox Not loading Data from store
By Jack_S in forum Ext 2.x: Help & DiscussionReplies: 5Last Post: 28 Nov 2008, 4:59 AM -
in ComboBox to change store loading of data?
By Hunterman in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 14 Aug 2008, 2:55 AM -
loading data into combo box using data store
By sathishs in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 25 Feb 2008, 5:52 AM -
Ext.data.Store - loading data and remembering page state
By bowmanmc in forum Ext 1.x: Help & DiscussionReplies: 6Last Post: 15 Aug 2007, 10:02 AM


Reply With Quote