I am attempting to develop a solution based on the example provided at:
As such, I am using BatchMode editing, binding a client datasource and all insert, update, delete done by calling Web Services from the clientside.
The grid is retrieving and displaying data successfully. I can update records and delete records, with the respective Web Services being called to update and delete successfully.
However, when I "Add new record", type in values, and hit "Save Changes", I can see in Chrome developer mode that there is no call to the Web Service so my data is not actually saved. There are no errors in the console either.
<telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" runat="server" AllowPaging="false" AllowSorting="true" AllowFilteringByColumn="false" ClientDataSourceID="RadClientDataSource1" > <MasterTableView ClientDataKeyNames="KeyName" EditMode="Batch" CommandItemDisplay="Top" BatchEditingSettings-HighlightDeletedRows="true" > <Columns> <telerik:GridBoundColumn DataField="KeyName" HeaderText="Parameter" DataType="System.String" HeaderStyle-Font-Bold="true" /> <telerik:GridBoundColumn DataField="KeyValue" HeaderText="Value" DataType="System.String" HeaderStyle-Font-Bold="true" /> <telerik:GridBoundColumn DataField="KeyType" HeaderText="Type" DataType="System.String" HeaderStyle-Font-Bold="true" /> <telerik:GridBoundColumn DataField="Description" HeaderText="Description" DataType="System.String" HeaderStyle-Font-Bold="true" /> <telerik:GridBoundColumn DataField="SplitPassword" HeaderText="Split Password" DataType="System.String" HeaderStyle-Font-Bold="true" /> <telerik:GridClientDeleteColumn HeaderText="Delete" HeaderStyle-Width="70px" HeaderStyle-Font-Bold="true" /> </Columns> </MasterTableView> <ClientSettings> <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="500px" /> </ClientSettings> </telerik:RadGrid> <telerik:RadClientDataSource ID="RadClientDataSource1" runat="server" AllowBatchOperations="true"> <ClientEvents OnCustomParameter="ParameterMap" /> <DataSource> <WebServiceDataSourceSettings BaseUrl="API/SysParm.asmx/"> <Insert Url="InsertSystemParameters" RequestType="Post" ContentType="application/json" DataType="JSON" /> <Select Url="GetSystemParameters" RequestType="Post" ContentType="application/json" DataType="JSON" /> <Update Url="UpdateSystemParameters" RequestType="Post" ContentType="application/json" DataType="JSON" /> <Delete Url="DeleteSystemParameters" RequestType="Post" ContentType="application/json" DataType="JSON" /> </WebServiceDataSourceSettings> </DataSource> <Schema ResponseType="JSON" DataName="d" > <Model ID="KeyName"> <telerik:ClientDataSourceModelField FieldName="KeyName" DataType="String" /> <telerik:ClientDataSourceModelField FieldName="KeyValue" DataType="String" /> <telerik:ClientDataSourceModelField FieldName="Description" DataType="String" /> <telerik:ClientDataSourceModelField FieldName="KeyType" DataType="String" /> <telerik:ClientDataSourceModelField FieldName="SplitPassword" DataType="String" /> </Model> </Schema> <SortExpressions> <telerik:ClientDataSourceSortExpression FieldName="KeyName" SortOrder="Desc" /> </SortExpressions> </telerik:RadClientDataSource>
This is an example of a record in the dataset:
{ "d": [{ "__type": "CAMAPI.SystemParameter", "KeyName": "AD_GROUPS_APP_ID", "KeyValue": "2", "Description": "", "KeyType": "APP_ID", "SplitPassword": "" }]}
My ParameterMap function is as follows:
function ParameterMap(sender, args) { if (args.get_type() != "read" && args.get_data()) { var data = "{ \"parameters\": " + JSON.stringify(args.get_data().models) + "}"; args.set_parameterFormat(data); }}
Can you see anything to explain why inserts are not working?
