Dec 19, 2008, 12:31 PM
[CLOSED] GridPanel update problems with ObjectDataSource
Hi,
I need to use a GridPanel control with an ASP.NET ObjectDataSource.
I start by defining the ObjectDataSource:
<asp:ObjectDataSource ID="objDSGroups" runat="server" DataObjectTypeName="WindowsGroup" TypeName="WindowsGroups" DeleteMethod="Delete" SelectMethod="Select" UpdateMethod="Update">
<DeleteParameters>
<asp:Parameter Name="GroupName" Type="String" />
</DeleteParameters>
I define the Store:<ext:Store ID="storeGroups" runat="server" OnBeforeRecordDeleted="BeforeGroupRecordDeleted" OnBeforeRecordUpdated="BeforeGroupRecordUpdated" DataSourceID="objectDataSourceGroups" RefreshAfterSaving="None" AutoLoad="True">
<Reader>
<ext:JsonReader ReaderID="GroupName">
<Fields>
<ext:RecordField Name="GroupName" Type="String" />
<ext:RecordField Name="IsAdmin" Type="String" />
<ext:RecordField Name="IsAuthor" Type="String" />
<ext:RecordField Name="IsLearner" Type="String" />
</Fields>
</ext:JsonReader>
</Reader>
<Listeners>
<CommitDone Handler="#{btnSave}.disable();" />
<Update Handler="#{btnSave}.enable();" />
</Listeners>
</ext:Store>
The GridPanel is hooked up to the Store - I'll omit the code for now.Problem #1: The Select method is called automatically and works fine, but the Update and Delete methods are not. As a workaround, I call these methods manually in the BeforeRecordUpdated and BeforeRecordDeleted handlers.
Problem #2: The BeforeRecordUpdated and BeforeRecordDeleted handlers are called only for the first affected row, not for each affected row.
Any suggestions?
Cheers,
Jason