PDA

View Full Version : Dynamic component and store creation - button press



Salakar
19 Sep 2013, 7:50 AM
Been trying to get this working for almost a week and no joy. I've only used extjs/architect for about 2 weeks so go easy on me please :D

Problem:
On a button press creating a component so for example a dataview with it's own fresh new store, so both store and dataview created at button press. I can create both of them no problem - i just can't seem to get them connected so to speak. They show as working - but adding a record to the store doesn't display on the dataview =/

Current code I've been trying (this is in my button handler) - quickly mashed this together just to show what i'm trying to do - fully commented on what's going wrong: http://pastebin.com/JmDRMhTz

T (http://pastebin.com/JmDRMhTz)hank you

jminnick
22 Sep 2013, 10:23 AM
Been trying to get this working for almost a week and no joy. I've only used extjs/architect for about 2 weeks so go easy on me please :D

Problem:
On a button press creating a component so for example a dataview with it's own fresh new store, so both store and dataview created at button press. I can create both of them no problem - i just can't seem to get them connected so to speak. They show as working - but adding a record to the store doesn't display on the dataview =/

Current code I've been trying (this is in my button handler) - quickly mashed this together just to show what i'm trying to do - fully commented on what's going wrong: http://pastebin.com/JmDRMhTz

T (http://pastebin.com/JmDRMhTz)hank you

At a quick glance; I see no where in your code where you're calling a load() and I don't see autoLoad: true.

Salakar
23 Sep 2013, 1:39 AM
I did have a store.load() further down in my code and it still wasn't working, just tried autoLoad also and still the dataview not rendering items - double checked the dataview and it does render correctly if store is not dynamically created. Checked the store and it is displaying the items that i added to it so not sure what's going on.

Arrrghhhhh :((

jminnick
23 Sep 2013, 8:40 AM
I did have a store.load() further down in my code and it still wasn't working, just tried autoLoad also and still the dataview not rendering items - double checked the dataview and it does render correctly if store is not dynamically created. Checked the store and it is displaying the items that i added to it so not sure what's going on.

Arrrghhhhh :((

Is there any chance you can send me the project?

Salakar
25 Sep 2013, 1:23 AM
Ok I will PM you the project later today, bear in mind though I'm fairly new at all so it's far from perfect and it's also far from finished with a lot of experimentation going on :P

p.s it's also built in SA 3 preview.