-
10 Oct 2010 4:13 PM #1
Combobox loaded remotely and scriptTagProxy question..
Combobox loaded remotely and scriptTagProxy question..
Hi! (sorry for my english..)
I'm trying to populate this combobox remotely but i can't figure out what is wrong with the code.. it works fine when i configure it to work locally but when i link the store to the remote url it doesn't load anything.. the code is very simple where is the error?? .. firebug doesn't show me any error .. therefore .. if i well intended the autoLoad property should fire the load action on the store as soon as possible right? Why it doesn't works in this example (i had to implement an afterender event to load the store..)?
live example
the code:
about the scripttagproxy question.. i read several examples (like this) implementing the scripttagproxy but they didn't use the callback parameter at all.. can someone explain me better this concept? this parameter must point to a real implementation of this callback function?Code:Ext.onReady(function() { new Ext.Window({ x:0, y:0, width:300, height:450, items:[ {xtype:'form', title:'Form', id:'testForm', width:'100%', layout:'form', items:[ { fieldLabel : 'Mezzo', name : 'mz', xtype : 'combo', displayField : 'descrizione', autoLoad:true, //mode : 'local', mode : 'remote', emptyText : 'seleziona un mezzo...', store : new Ext.data.XmlStore({ record:'mezzo', //url:'data/mezzi.xml' url:'leggimezzi.php', fields:['descrizione'] }), listeners: { afterrender:function(){this.store.load();} } } ] } ] }).show(); });
thanks very much for your help!!..
-
11 Oct 2010 1:16 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
1. You probably want to configure your combobox with triggerAction:'all'.
2. Do not use width:'100%'. Instead, make your window layout:'fit'.
3. You know you can't use a ScriptTagProxy with XML?
-
11 Oct 2010 1:36 AM #3
But with that being a relative URL, there's no need to use ScriptTagProxy. It's random coding.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
11 Oct 2010 5:47 PM #4
thanks for your answers they were useful..
Ok Condor, setting that property if i press the down arrow the combobox load the store but the autocomplete function still doesn't work in the remote version..You probably want to configure your combobox with triggerAction:'all'
why it work properly in the local version and not remotely?? what i'm missing??
try the live example.. now it shows both the versions .. the behaviour is different and i don't know why..
i setup an XmlStore on the fly is some other property needed to work remotely? some property to set in the form-panel configuration?But with that being a relative URL, there's no need to use ScriptTagProxy. It's random coding.
about the STProxy i simple didn't understood well the callback property and how to use it.. sorry if i didn't explain myself right ..
i report the code regarding the 2 comboboxes
thanks very much for your help..Code:Ext.onReady(function() { new Ext.Window({ x:20, y:20, width:300, height:250, items:[ {xtype:'form', title:'Form', id:'testForm', layout:'form', items:[ { fieldLabel : 'Remote', name : 'mz_r', xtype : 'combo', triggerAction:'all', displayField : 'descrizione', autoLoad:true, mode : 'remote', emptyText : 'seleziona un mezzo...', store : new Ext.data.XmlStore({ record:'mezzo', url:'leggimezzi.php', fields:['descrizione'] }), listeners: { afterrender:function(){this.store.load();} } }, { fieldLabel : 'Local', name : 'mz_l', xtype : 'combo', displayField : 'descrizione', autoLoad:true, mode : 'local', emptyText : 'seleziona un mezzo...', store : new Ext.data.XmlStore({ record:'mezzo', url:'data/mezzi.xml', fields:['descrizione'] }), listeners: { afterrender:function(){this.store.load();} } } ] } ] }).show(); });
-
11 Oct 2010 11:19 PM #5Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
In remote mode autoComplete starts working after typing minChars (defaults to 4).
-
12 Oct 2010 7:58 PM #6
thanks Condor i missed that property but it wasn't the cause of the problem. I read more carefully the documentation and i solved the question: the property 'mode' must be set to '_local_' even for the remote combobox!.. the autocomplete function didn't work because the remote mode force to load the entire store each time.. i hope this could be useful for other users!!
Any suggest about the scriptTagProxy question?
-
12 Oct 2010 11:34 PM #7
Yes. As I said, you don't need to use it!
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
12 Oct 2010 11:51 PM #8Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
1. mode:'remote' is especially useful when using triggerAction:'query'. For triggerAction:'all' I would indeed suggest to preload the store and use mode:'local'.
2. Why are you interested in ScriptTagProxy? You don't have to make requests to a different domain and your are using XML. Both reasons why you don't need/can't use ScriptTagProxy.
Similar Threads
-
Combobox loads and submits remotely ok, but shows valueField on form load from URL
By jsemmanuel in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 25 Nov 2009, 6:30 AM -
Help loading combobox remotely...
By Liminality in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 4 Jun 2009, 12:22 PM -
ComboBox load data from store remotely
By Choleriker in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 29 Aug 2007, 2:38 AM -
Please Help: Not able to load data on Combobox remotely using JSONStore?
By marimuthup in forum Ext 1.x: Help & DiscussionReplies: 4Last Post: 16 Jul 2007, 3:07 AM


Reply With Quote