PDA

View Full Version : Combobox store with dynamic load



rsoria03
15 Apr 2016, 9:28 PM
Hi.

I have a little trouble with the dynamic load of stores in comboboxes. I want to preserve the values in the combobox after a window is displayed, closed and displayed again. The store in the combobox doesn't need to call the json because the window is never destroyed, only hidden. After many tests I could not make it work as I expect.

Here is the fiddle: https://fiddle.sencha.com/#fiddle/18qv (see the openModal method in Main controller)

I found this thread that give some ideas but none of them worked: ComboBox-ArrayStore-dynamic-load (https://www.sencha.com/forum/showthread.php?262398-ComboBox-ArrayStore-dynamic-load-in-4.2-(working-example))

jdkhamba
16 Apr 2016, 5:15 AM
Seems like a lot of code for something so trivial. Take a look:

https://fiddle.sencha.com/#fiddle/18r5

In the controller simply have a class variable (this.) which checks if the window is created or not and create if it is not there then show it.

rsoria03
16 Apr 2016, 7:32 AM
I write all that code in order to simulate the app where I have the error, but I understand your point. Your jsfiddle code doesn't display something but I saw my problem, I was creating again and again the modal window without checking if it exists. I think this error was caused by tiredness because I was coding at 3 a.m.


Thanks for the reply.

jdkhamba
16 Apr 2016, 7:43 AM
Sencha fiddle is acting weird by defining the classes in wrong order. I have fixed that by putting all the code in the app.js file. But I am sure your browser will work just fine with the folder structure.