Threaded View
-
24 Nov 2011 2:45 PM #1
Answered: Loading data into a component without a Store
Answered: Loading data into a component without a Store
Hi all!
I'm a Flex refugee and I'm slowly making my way through ExtJS.
I'm porting over an ActionScript 3.0 library for doing web-services to an open-source backend I've written, and I want to find out if there's any way to load data into an ExtJS component without a Store? Is this a really stupid question because I don't understand ExtJS yet?
I'd appreciate any and all help!
-
Best Answer Posted by dannykopping
OK - I think I've solved the problem.
I've got a callback on an AJAX request which runs the following code:
I've got a component called userlist1 which I manually bind a Store to using the bindStore function, and then load the response data (which is an array of User model instances) into the Store. This example is using a predefined Store definition, but it's trivial to create a temporary Store on the fly (I'd imagine) and then bind that to a View.Code:success: function(response){ var list = Ext.getCmp("userlist1"); var store = Ext.getStore("Users"); list.bindStore(store); store.loadData(response); }


Reply With Quote