Data Does Not Show /Render in I.E 9

Data Does Not Show /Render in I.E 9

hksdhksd Posts: 15Questions: 0Answers: 0
edited August 2012 in DataTables 1.9
Hi All,

i have a problem when using Datatables server side processing with I.E. 9, the data does not showed or rendered. but when i used firefox it run well.
the server side response with json. and using json validation it's tell that the json is valid.

it's look like it failed from var _fnJsonString = (window.JSON) ? JSON.stringify : function( o ) ( My guess).

after look from other discussion http://datatables.net/forums/discussion/700/server-side-processing-hangs-at-loading-data-from-server#Item_22 . it show using json2.js .. i have include it in my html head tag but it does not effect anythink.

here is my json

[code]
{"aaData":[[3,"Sore","asdasd","",""],[2,"Siang","asdasd","",""],[1,"Pagi","D:\\Src\\Pagi","",""]],"iTotalDisplayRecords":3,"iTotalRecords":3,"sEcho":"1"}
[/code]

here is my html
[code]



id
Batch Name
Source Path
edit
delete









jQuery.fn.dataTableExt.oApi.fnFilterOnReturn = function (oSettings) {
var _that = this;

this.each(function (i) {
$.fn.dataTableExt.iApiIndex = i;
var $this = this;
var anControl = $('input', _that.fnSettings().aanFeatures.f);
anControl.unbind('keyup');

$("#btnSearch").bind( "click",function(){
$.fn.dataTableExt.iApiIndex = i;
_that.fnFilter($("#txtSearch").val());
});

return this;
});
return this;
};

var oTable;

$(document).ready(function() {
oTable = $('#batchDT').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "dtbatch.action",
"sServerMethod": "POST",
"aaSorting": [[ 1, "desc" ]],
"sDom" : "ltiprf",
"oLanguage": {
"sInfo": "Total Records : _TOTAL_ ",
"sInfoEmpty": ""

},
'aoColumns': [
{
"sWidth" : '70px',
"bVisible" : false
},
{
"sWidth" : '70px'
},
{
"sWidth" : '70px'
},
{
"sWidth" : '70px',
"bSortable": false,
"sClass": "center",
"sDefaultContent": "Edit",
"fnRender": function ( o, val ) {
return 'Edit';
}
},
{
"sWidth" : '70px',
"bSortable": false,
"sClass": "center",
"sDefaultContent": "Delete",
"fnRender": function ( o, val ) {
return 'delete';
}
}
],

'bFilter':true,
'bInfo': true,
'iDisplayLength': 10,
'sPaginationType': 'full_numbers' ,
"bLengthChange" : false
}).fnFilterOnReturn();

} );



[/code]

Replies

  • hksdhksd Posts: 15Questions: 0Answers: 0
    Does anyone have a clue?
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Can you run the DataTables debugger over the table, or give us a link to it please?

    Allan
  • hksdhksd Posts: 15Questions: 0Answers: 0
    Hi Allan,

    How do you do?

    i have try your suggestion but it seem like it take to long time or hang or datatables debugger status is uploading data to server

    Best Regards,
    Handinata Kusuma
  • hksdhksd Posts: 15Questions: 0Answers: 0
    Hi Allan,

    If i Debug in Firefox is it okay? it look like in I.E the datatables debugger is hang


    Best Regards,

    Handinata Kusuma
  • hksdhksd Posts: 15Questions: 0Answers: 0
    Hi Allan,

    here is in firefox :

    http://debug.datatables.net/umugip
  • hksdhksd Posts: 15Questions: 0Answers: 0
    it is running well in Chrome... , why just in IE get problem .. :~(
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Thanks for the debug trace. I'm afraid I don't know why that wouldn't work in IE - it looks like it should. I'd need a link to the page to be able to offer any more help I'm afraid.

    Allan
  • hksdhksd Posts: 15Questions: 0Answers: 0
    Hi Allan,

    i think i know what makes the data not render in IE. it because the charset in IE. should UTF-8 not UTF8.

    so check the response header
    [code]
    Content-Type application/json;charset=UTF8
    [/code]

    it should be :

    [code]
    Content-Type application/json;charset=UTF-8
    [/code]

    cause in IE it strictly must UTF-8. :D

    Best Regards,
    Handinata Kusuma
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Fair enough! What was setting the content type header?

    Allan
  • hksdhksd Posts: 15Questions: 0Answers: 0
    Hi allan,

    because we use struts2 and the struts.properties file we set :
    before
    [code]
    struts.i18n.encoding=UTF8
    [/code]

    we change to:
    after :

    [code]
    struts.i18n.encoding=UTF-8
    [/code]

    Case Closed....

    Best Regards,

    Handinata Kusuma
This discussion has been closed.