Hi,
I am using $.post to retrieve data from mysql and display it in either jqGrid or slickGrid grids. I don't think they are the problem because it fails before they are even called. If my mysql select statement has limit 22, then it works perfectly in either one. If my mysql select statement has limit 23 (or greater), then they both fail and it looks like things fail even before they are invoked. I know that using limit 23 succeeds as a mysql call because if I run the php function from the command line I see the output.
I've tried setting async to false and setting a 5 second timeout, but that didn't help. I'm pretty sure this is a pure javascript issue and not jquery or either grid plugin. I put in alert messages after every line and I know where it fails.
The php script returns json formatted string. Since php is returning a string, not a json object, setting the dataType: json doesn't work.
Here is the code:
Code:
var hoursdata = [];
jQuery.ajaxSetup({async:false, timeout: 5000});
$.ajax({
type: "POST",
url: "adminfunctions.php",
data: {task: "getAllHours"},
timeout: 5000,
async: false,
success: function(data){
window.hoursdata = eval(data);
var mylength = Math.min(hoursdata.length, 50);//fails here if data is too large
for(var i=0;i<=mylength;i++){
jQuery("#list27").jqGrid('addRowData',i+1,window.hoursdata[i]);
}
}
});
The data fails if the returned data is 7,236 bytes (approx) and works if the data is 6,884 bytes. There's going to be close to 5 megs of data returned for the users to work with. Yeah, I know that's a lot of data, but even if I add some filters and only show information for 1 person, I'll have the same problem. Displaying 50 rows should not be a problem, let alone 23.
Any ideas what might be happening?
Thanks!