Feb 10, 2010, 4:54 AM
Get GridPanel rows on the store events.
Hi,
How can i get the grid's data from the store events?
I try the following, but it is not working!
when i try to get to the grid on one of the store event, Exception is thrown, for example:
Thanks in advance!!!
Yossi.
How can i get the grid's data from the store events?
I try the following, but it is not working!
<ext:Store ID="StoreBlockingRuleDetails" AutoLoad="true" DataSourceID="BlockingRuledetailsDataSource" runat="server"
OnRefreshData="StoreBlockingRulesDetails_Refresh"
OnBeforeRecordInserted="StoreBlockingRulesDetails_BeforeRecoedInserted"
OnBeforeRecordUpdated="StoreBlockingRulesDetails_BeforeRecoedUpdated"
OnAfterAjaxEvent="StoreBlockingRulesDetails_AfterAjaxEvent"
OnBeforeRecordDeleted="StoreBlockingRulesDetails_BeforeRecordDeleted"
OnBeforeStoreChanged="test1"
OnBeforeAjaxEvent="test2"
OnSubmitData="test3"
ShowWarningOnFailure="false" >
<BaseParams>
<ext:Parameter Name="DetailsGrid" Value="Ext.encode(#{BlockingRuleItemsGrid}.getRowsValues(false))" Mode="Raw" />
</BaseParams>
<Reader>
<ext:JsonReader ReaderID="BLOCK_RULE_DETAIL_ID">
<Fields>
<ext:RecordField Name="BLOCK_RULE_DETAIL_ID" Type="Int">
<Convert Handler="" Args="value,record" FormatHandler="False"></Convert>
</ext:RecordField>
<ext:RecordField Name="BLOCK_RULE_ID" Type="Int">
<Convert Handler="" Args="value,record" FormatHandler="False"></Convert>
</ext:RecordField>
<ext:RecordField Name="BLOCK_TYPE_ID" Type="Int">
<Convert Handler="" Args="value,record" FormatHandler="False"></Convert>
</ext:RecordField>
<ext:RecordField Name="BLOCK_VALUE" Type="String">
<Convert Handler="" Args="value,record" FormatHandler="False"></Convert>
</ext:RecordField>
</Fields>
</ext:JsonReader>
</Reader>
<SortInfo Field="BLOCK_TYPE_ID" Direction="ASC" />
<Listeners>
<LoadException Handler="Ext.Msg.alert('Blocking Rules - Load failed', e.message || e )" />
<CommitFailed Handler="Ext.Msg.alert('Blocking Rules - Commit failed', 'Reason: ' + msg)" />
<SaveException Handler="Ext.Msg.alert('Blocking Rules - Save failed', e.message || e)" />
<CommitDone Handler="Ext.Msg.alert('Blocking Rules - Commit', 'The data was successfully saved');" />
</Listeners>
</ext:Store>
<ext:Store ID="StoreCboxBlockRuleType" runat="server">
<Reader>
<ext:JsonReader ReaderID="BLOCK_TYPE_ID">
<Fields>
<ext:RecordField Name="BLOCK_TYPE_ID" />
<ext:RecordField Name="BLOCK_TYPE_NAME" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
While BlockingRuleItemsGrid is a gridpanel.when i try to get to the grid on one of the store event, Exception is thrown, for example:
protected void test1(object sender, BeforeStoreChangedEventArgs e)
{
Store store = (Store)sender;
string detailsGrid = store.BaseParams["DetailsGrid"];
Dictionary<string, string>[] gridData = JSON.Deserialize<Dictionary<string, string>[]>(detailsGrid);
}//Here I get Exception
Can you help me with this??Thanks in advance!!!
Yossi.