This is a migrated thread and some comments may be shown as answers.

JSON and WCF ( CRUD) - Batch update mode (Kendo Grid)

1 Answer 91 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 26 Feb 2013, 08:29 AM
Hi ,

I am trying to do a batch update mode on a kendo grid. I am finding some troubles retrieving the call back from the web service.
Actually when I set to batch: false , it passes no of row changes one by one to the web service.

this is the web service.

 [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare,
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "Get/Update?ID={ID}&StdID={StdID}&Name={Name}"
            )]
        public void Update(int ID, int StdID, string Name)
        {
            ElementData.UpdateElement(ID, StdID, Name);
        }

although this is webGet Method it is working for inline editing on the grid ( when batch: false)

But I really want to do a batch update and show a message to user that it has been successfully committed , or the error occurred.

this is how I call to web service for the inline update.

 update: {
                    url: "../service/jsonservice.svc/Get/Update",
                    dataType: "jsonp"                   
                    },


my web config methods are as following :

<system.serviceModel>
    <behaviors>
      <endpointBehaviors>
        <behavior name="Retails.Service.JsonServiceAspNetAjaxBehavior">
          <webHttp />
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <services>
      <service name="Retails.Service.JsonService">
        <endpoint address="" behaviorConfiguration="Retails.Service.JsonServiceAspNetAjaxBehavior" binding="webHttpBinding" contract="Retails.Service.JsonService" />
      </service>     
    </services>      
  </system.serviceModel>


Can you please help me how to do the batch update mode. I have gone through with a kendo telerik sample for crud methods.  But here I can't use the web service like that. Because It has already been developed for some other functions.

Anyway can you please tell me way to write a method in web service and a method to call the update method  to do a batch update .

And I want to show a feedback to the user saying it has been updated successfully .


1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 28 Feb 2013, 08:36 AM
Hello Kevin,

I am not sure if I understand what is the difference with the "grid-wcf-crud" example from our GitHub repository. Could you clarify a bit this line?

But here I can't use the web service like that. Because It has already been developed for some other functions.

As general information I can say that you should use WebInvoke and a POST request with the data sent as JSON. If you need to get the updated items along with some other parameters, you should also use a wrapped BodyStyle.

Regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Kevin
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or