Jun 21, 2012, 7:31 PM
[CLOSED] RowSelectionModel RowSelect Handler problem
Hi,
My RowSelect Handler invokes a DirectMethod, which repopulates the Store of a details form combobox bound to GridPanel. The details form controls need to be rebound AFTER the data retrieval is completed:
Is there any way to ensure that the data retrieval on the server is actually finished and only then proceed with details form data binding? I realize this mechanism is available via DirectEvents but for some reason if I put it into RowSelect DirectEvent for RowSelectionModel and comment out the Listener, it's not executed at all. Please advise or suggest a better approach.
Thanks,
Vadym
My RowSelect Handler invokes a DirectMethod, which repopulates the Store of a details form combobox bound to GridPanel. The details form controls need to be rebound AFTER the data retrieval is completed:
<SelectionModel>
<ext:RowSelectionModel runat="server" SingleSelect="true">
<Listeners>
<RowSelect Handler="X.RetrieveData(record.data['fld1'], record.data['fld2'], {eventMask: {showMask: true} });
#{FormPanel1}.getForm().loadRecord(record);
#{FormPanel1}.record=record;" />
<SelectionChange Handler="#{HiddenSelectedRow}.setValue(Ext.encode(#{GridPanel1}.getRowsValues({selectedOnly: true})));" />
</Listeners>
[DirectMethod]
public void RetrieveData(string fld1, string fld2)
{
DataTable dt = GetDataTable(fld1, fld2);
this.StoreComboBox1.DataSource = dt;
this.StoreComboBox1.DataBind();
}
I'm getting inconsistent results since I believe the Ajax call is not guaranteed to complete before the rest of Handler client code is executed. So, the details form is bound with some garbage data as a result. At least, that's my guess.Is there any way to ensure that the data retrieval on the server is actually finished and only then proceed with details form data binding? I realize this mechanism is available via DirectEvents but for some reason if I put it into RowSelect DirectEvent for RowSelectionModel and comment out the Listener, it's not executed at all. Please advise or suggest a better approach.
Thanks,
Vadym
Last edited by Daniil; Jun 22, 2012 at 4:37 PM.
Reason: [CLOSED]