LoadData does not work
See original GitHub issueHi, I am new in jquery… I have been struggled to deal with loadData in jsgrid… I am using Webform instead of MVC…
Here my code on aspx
$("#jsGrid").jsGrid({
height: "auto",
width: "100%",
sorting: true,
paging: false,
autoload: true,
controller: {
loadData: function (filter) {
return $.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
url: "JsGridTesting.aspx/GetDataJSON",
dataType: "json"
});
}
},
fields: [
{ name: "Name", type: "text" },
{ name: "Description", type: "text", width: 150 }
]
});
and here is my code on server side
<System.Web.Services.WebMethod()> _
<ScriptMethod(ResponseFormat:=ResponseFormat.Json, UseHttpGet:=True)>
Public Shared Function GetDataJSON() As String
Dim obj1 As New Student() With {.Name = "Mick Jagger", .Description = "bar"}
Dim obj2 As New Student() With {.Name = "Johnny Storm", .Description = "bar"}
Dim obj3 As New Student() With {.Name = "Richard Hatch", .Description = "bar"}
Dim obj4 As New Student() With {.Name = "Kelly Slater", .Description = "bar"}
Dim objStudentList As New List(Of Student)() From {obj1, obj2, obj3, obj4}
Dim objJSSerializer As New System.Web.Script.Serialization.JavaScriptSerializer()
Dim strJSON = objJSSerializer.Serialize(objStudentList)
Return strJSON
End Function
I have checked that my GetDataJSON has return JSON data correctly but the grid cannot bind the data properly… Please help me…
Issue Analytics
- State:
- Created 7 years ago
- Comments:17 (5 by maintainers)
Top Results From Across the Web
WebView.loadData not working on Android 9.0 (API-29)
I solved my problem, the problem occurs in Smartphones that has latest Chrome. SOLUTION: Do not use. mWebview.loadData. method, instead use.
Read more >LoadData Function not responding properly
I am currently trying to build an offline solution for my app using the SaveData/LoadData functions. The logic I am using is that...
Read more >loadData fails to insert data when usePreparedStatements=true
If I change the usePreparedStatements="true" to usePreparedStatements="false" in the loadData changesets, the data is populated correctly. I ...
Read more >WebView.loadData(data, mimeType, encoding) bug with ...
If the "data" string in WebView.loadData(data, mimeType, encoding) contains an anchor with a href that contains the symbol "#", WebView will stop the...
Read more >Why does dumpdata, flush, loaddata cycle not result in same ...
I have a simple project using the flatpages app. If I use manage.py to run dumpdata (with no command line arguments, redirecting output...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
No, as you can see your response is not an array of objects, but an object with a field
d
where all data is just a string that you should parse. So in this case it should be at leastdata.resolve(response.d)
or evendata.resolve(JSON.parse(response.d))
.Hey! I think loadData expects a promise. Something similar to this should work.