Nov 13, 2012, 9:19 PM
[CLOSED] [2.1] Example - /Associations/HasMany/Simple/
Regarding this example of a simple HasMany association:
First, I cannot find any documentation of method .bindStore() on gridpanel or panel. It seems to exist for charts and some other controls, but is not listed in sencha API 4.1.3 definition of panel or gridpanel. Is this method inherited from a base class? Where does it come from? Is examples explorer using a different version of extjs than 4.1? Also, my understanding is that it is supposed to replace the grid's internal store and refresh the view. Correct?
Second, the call to .products() - I believe this is the automatically generated getter function for the HasManyAssociation. As I understand, it returns a store, which is a collection of Product model instances. Is this a synchronous call, i.e. execution waits until it is complete? In this example, the data is already available to the client, so it doesn't matter, but the associated model can also be loaded lazily via proxy, so it is important to know. Can this method accept a callback or object with callback/success/failure similar to the generated getter for HasOne?
protected void Page_Load(object sender, EventArgs e){
Store1.Data = this.Users;
}
I have read elsewhere that the Store class behaves differently when data is assigned to the .Data property, as opposed to databinding with .DataSource property. It has something to do with serialization, I think? Can anyone explain the difference between loading data to a store with these two different methods, and when to use each?<SelectionChange Handler="selected.length && #{ProductsGrid}.bindStore(selected[0].products());" />
Two questions about this. First, I cannot find any documentation of method .bindStore() on gridpanel or panel. It seems to exist for charts and some other controls, but is not listed in sencha API 4.1.3 definition of panel or gridpanel. Is this method inherited from a base class? Where does it come from? Is examples explorer using a different version of extjs than 4.1? Also, my understanding is that it is supposed to replace the grid's internal store and refresh the view. Correct?
Second, the call to .products() - I believe this is the automatically generated getter function for the HasManyAssociation. As I understand, it returns a store, which is a collection of Product model instances. Is this a synchronous call, i.e. execution waits until it is complete? In this example, the data is already available to the client, so it doesn't matter, but the associated model can also be loaded lazily via proxy, so it is important to know. Can this method accept a callback or object with callback/success/failure similar to the generated getter for HasOne?
Last edited by Daniil; Nov 19, 2012 at 9:22 AM.
Reason: [CLOSED]