jQWidgets Forums
Forum Replies Created
-
Author
-
November 11, 2013 at 6:31 pm in reply to: Grid Refresh without Reloading Parent Window Grid Refresh without Reloading Parent Window #32413
Peter,
Thanks for the response and it’s working. However you haven’t responded to my second question:
2. How can I reflect the real time data from a data source on the grid without refreshing the grid window. Is it possible to use a timer, say at the interval of 5 milliseconds to fetch the updates and show on the grid instantly? If yes, please show me the sample code for it.Regards
October 30, 2013 at 11:14 pm in reply to: JSON.parse error: Unexpected end of data JSON.parse error: Unexpected end of data #31655Hi Peter,
Thanks for your untiring support I however managed to fix the problem. It wasn’t related to JSON format but for some reason ASP.NET MVC was not loading the returned JSON data from the server fo a reason I dont know. So instead of the writing the javascript code that fetches data from a controller separately in another file and attach it to the view using tags, I just added the code to the cshtml page just after the header between …here… tags. And boom! it worked!!
Thanks!
October 29, 2013 at 9:16 pm in reply to: JSON.parse error: Unexpected end of data JSON.parse error: Unexpected end of data #31554Hi Peter,
I have tried it’s working but when I try to retrieve the data from the server of my application, it’s giving no errors. If I use the function JSON.stringify(sample data), the grid is not populating still even when the json string is correctly formatted.
October 29, 2013 at 5:31 pm in reply to: JSON.parse error: Unexpected end of data JSON.parse error: Unexpected end of data #31538It is the exact data returned from the server. If I parse it directly to the jqxGrid it’s saying no data to display. And when I try to format it ,still the jqxgrid widget is failing to display the data. How do I correctly format it and parse it to JSON?
October 28, 2013 at 9:05 pm in reply to: JSON.parse error: Unexpected end of data JSON.parse error: Unexpected end of data #31489Peter,
I am able to populate the grid without errors if I use the datasource I created manually, but if I use the returned json string from the server directly, the browser is throwing the json.parse unexpected end of data error. Am not sure what I am doing wrongly.
October 28, 2013 at 7:59 pm in reply to: JSON.parse error: Unexpected end of data JSON.parse error: Unexpected end of data #31486Thanks Peter for the reply.
Let me paste the actual data in my code for the comparison.
Manually created json string variable:
var datasource ='[{ “DeptName”: “Finance”, “DeptID”: “Fin001”},{“DeptName”: “Human Resources”,”DeptID”: “HR003”},{ “DeptName”: “Infomation Technology”, “DeptID”: “IT002”},{ “DeptName”: “Operations”, “DeptID”: “Opts004”},{ “DeptName”: “Treasury”, “DeptID”: “Trsy-03”}]’;
Returned JSON string from the server:
[{“DeptName”: “Finance” ,”DeptID”: “Fin001”},{“DeptName”: “Human Resources” ,”DeptID”: “HR003”},{“DeptName”: “Infomation Technology” ,”DeptID”: “IT002”},{“DeptName”: “Operations” ,”DeptID”: “Opts004”},{“DeptName”: “Treasury” ,”DeptID”: “Trsy-03”}]
I cant seem to find the error.
October 18, 2013 at 10:53 pm in reply to: How to retrieve json data from asp.net controller to a view with jqgrid How to retrieve json data from asp.net controller to a view with jqgrid #31031mates,
I am still failing to retrive any data from my controllers. All I am getting is [object],[object],[object],[object] as results. My code is as below:
———————————————————————————————————–
the code part that sends the request to the controller on the server from the view
————————————————————————————————————
@model IEnumerable@{
ViewBag.Title = “Index”;
}$(document).ready(function(){
var theme = getDemoTheme();
var title =’Department Details’;
var url = ‘/Department/GetDepartments’;var rowdata =[];
$.ajax({
type: ‘POST’,
url: url,
datatype: ‘json’,
success: function(data){
//rowdata = data;
alert(data); //here I am alerting just to see the results
}
});—————————————————————————————–
the controller code
—————————————————————————————–[HttpPost]
public JsonResult GetDepartments()
{
var result = db.Departments.ToList();
var departments = from d in result
select new {d.DeptID,d.DeptName};
return Json(departments);
}Where Am I going wrong?
October 17, 2013 at 6:34 pm in reply to: How to retrieve json data from asp.net controller to a view with jqgrid How to retrieve json data from asp.net controller to a view with jqgrid #30961Thanks Peter,
I will look into it.
August 29, 2013 at 8:19 am in reply to: Type Error Undefined in jqxwindow.js library Type Error Undefined in jqxwindow.js library #27931I am using Mozilla Firefox ver 23.01 and Chrome. How can I know I am referencing the libraries correctly?
-
AuthorPosts