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.
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.