0

I'm searching for how other extjs developers work on a UI component before the json response from the backend is hooked up and working.

Feel free to be specific with code samples of how I might toggle back and forth between live data and a hard coded counterpart.

Is there one method of hard coding a datastore that can be used by every component or does each component require variations?

How would I use a remote datastore and only swap out one field value with hardcoded data?

Sorry for multiple questions, I guess what I'm really looking for is advice on what other extjs developers have found to be able to work on and test custom views without relying on the server for data.

Thanks

DaveAlger
  • 2,376
  • 25
  • 24

1 Answers1

1

For the scenario you describe, I have created a store with hard-coded data and tied a component, in my case a chart and grid, to the store. Now when I get the live data from the server all I do is update my store which in turn updates the chart.

I am not sure if this is the answer you're looking? I can certainly give you some code examples if that will add value to this answer. Let me know.

pacman
  • 1,061
  • 1
  • 17
  • 36
  • Do you just create a var called tempStore or something in a global js file and assign it to various views in your application? since I'm still new to the sencha frameworks I spend all my time searching instead of coding. I'm impressed with how well all the components work once I figure out what all the settings do. – DaveAlger May 18 '12 at 21:35
  • 1
    Well if you are not creating Ext's mvc architecture you might have to do something like that where you have a file that shares global stores that you import in each page, but if you are planning to convert your app to EXT mvc, creating and using store becomes much more cleaner.. – pacman Jun 07 '12 at 15:36
  • 1
    thanks for the pointers. i've found something that works and accepting your answer for offering help/advice to get me on the right track. if you could update this answer to provide a code sample of how you would create a hardcoded data object for users and userGroups along with two different ui components using the same data objects that would be great to see as well... – DaveAlger Jun 12 '12 at 21:18