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

Kendo ui Grid transport Update- Not Working

2 Answers 717 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Binny
Top achievements
Rank 1
Binny asked on 16 Jul 2014, 11:13 AM
Hello,

I'm new to Kendo ui grid and Juery.

Working on the Kendo ui grid with an Asp Page for a report (no MVC).

Managed to read the data(using json) but update seems  to be problem.

I can't figure a way to find the data send to server side. 

Technically, my web method in the aspx page is not triggered,transport update is not triggered as well.
Also. some tell me how to debug the kendo it'll be great. Stuck in this for the last two days

Jquery
 var dataSource = new kendo.data.DataSource({
              //autoSync: true,
              transport: {
//Working
                     read: {
                          url: "/Ajax/testAjax.aspx/GetInactiveBrokerData",           
                          type: "POST",
                          dataType: "json",
                          contentType: "application/json; charset=utf-8"
                             },
//Not working
                     update:               
                         {
                             url: "/Ajax/testAjax.aspx/updateBrokersInactiveData",
                             type: "POST",
                             dataType: "json",
                             contentType: "application/json; charset=utf-8"
                             //contentType: "application/x-www-form-urlencoded; charset=UTF-8"
                         },
                     parameterMap:
                            function (options, operation) {
//Working
                                if (operation == "read") {
                                    console.log('Transport READ Event Raised');
                                    //return { models: JSON.stringify(options.models) };
                                }
                                if (operation == "update" ) {
//Not Working
                                    console.log('Transport UPDATE Event Raised');
                                    //return { models: JSON.stringify(options.models) };
                                    }
                                },
                     batch: true,
                     schema: {
                         model: {
                             id: "intLogID",
                             fields: {
                                 intLogID: { type: "number", editable: false, nullable: false },
                                 dtConDate: { type: "date" },
                                 strBranchID: { type: "string", editable: false },
                                 strQuickComments: { type: "string" },
                                 strBranchName: { type: "string", editable: false }
                                        }
                                 }
                             }
                },
                   pageSize: 25
                                         });
              $("#grid").kendoGrid({
                  columns: [

                                                {
                                                    field: "dtConDate",
                                                    title: "Last Contact Date",
                                                    width: 150
                                                }, {
                                                    field: "strBranchID",
                                                    title: "Branch ID",
                                                    width: 100
                                                }, {
                                                    field: "strBranchName",
                                                    title: "Branch Name",
                                                    width: 200
                                                }, {
                                                    field: "strQuickComments",
                                                    title: "Quick Comments",
                                                    width: 250
                                                }],
                  dataSource: dataSource,
                  pageable: {
                      refresh: true,
                      messages: {
                          refresh: "Refresh the grid"
                      },
                      pageSizes: [5, 10, 50, 100],
                      buttonCount: 3
                            },
                  
                  height: 550,
                  groupable: true,
                  navigatable: true,
                  sortable: true,
                  pageSize: 25,
                  resizable: true,
                  filterable:true,
                  toolbar: ["save", "cancel"],  
                  editable: true,
                  saveChanges: function (e) {
                      if (!confirm("Are you sure you want to save all changes?")) {                   
                          e.preventDefault();                      
                      }
                  }
              });

Aspx
 <System.Web.Services.WebMethod()> _
    Public Shared Sub GetInactiveBrokerData()
        HttpContext.Current.Response.Write(getJsonData)
        HttpContext.Current.Response.Flush()
        HttpContext.Current.ApplicationInstance.CompleteRequest()
        HttpContext.Current.Response.SuppressContent = True
    End Sub
    
    <System.Web.Services.WebMethod()> _
    Public Shared Sub updateBrokersInactiveData(ByVal lstTracker As List(Of Tracker))
        'Dim json As String = Request("models")
        Dim strUpdOutput As String = ""
        conMyData = New SqlConnection(ConfigurationManager.AppSettings("tracker"))
        cmdSelect = New SqlCommand("[sunworldplus].[tracker_new_inactive_brokers_update_comments]", conMyData)
        conMyData.Open()
        cmdSelect.CommandType = CommandType.StoredProcedure
        sqldr = cmdSelect.ExecuteReader
        
        While sqldr.Read()

        End While
        
        If IsNothing(sqldr) Then
            sqldr.Close()
            conMyData.Close()
        End If
        ''Return strUpdOutput
    End Sub

It'll be great if someone point me in the right direction.

2 Answers, 1 is accepted

Sort by
0
Pritam
Top achievements
Rank 1
answered on 16 Jul 2014, 12:31 PM
Hello,
i am working with vs2012 and kendo framework(2013.3.1119.340).
Application work properly in All browser except IE 9 and IE 10.
Actually problem is when we edit(Batch editing in kendo grid ) in kendo
grid and click on save button that time page is not reloading.
Can you suggest how to reload page?
 

Its kendo grid problem in IE9?

 

Can you please suggest solution.
0
Binny
Top achievements
Rank 1
answered on 16 Jul 2014, 04:15 PM
Guys Found the problem in my code. 

Schema and batch is writted inside transport.

Sorry guys silly mistake.

Will keep you posted.

Tags
Grid
Asked by
Binny
Top achievements
Rank 1
Answers by
Pritam
Top achievements
Rank 1
Binny
Top achievements
Rank 1
Share this question
or