Is there an easy way to override one of the fields in an extjs store to hard coded values while the backend is figuring out how to add the new object?

StackOverflow https://stackoverflow.com//questions/10659102

  •  11-12-2019
  •  | 
  •  

Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top