datatables in IE8 No matching records found

datatables in IE8 No matching records found

psihonavtpsihonavt Posts: 4Questions: 0Answers: 0
edited March 2010 in General
hello!
first of all: datatables plugin rules the world! :)
second: i've faced with strange problem. i'm using datables for displaying reports ("server-side" mode) result displaying great in ff, opera, safari, chrome. but in IE8(6) i got "No matching records found", i've installed fiddler for checking server's response and it looks totally right!

here is html:

[code]
{% extends "site/base.html" %}

{% block add-script-css %}



-
{% endblock %}

{% block content %}




Site Name
Date
Impressions
Clicks




Loading data from server




{% endblock %}
[/code]
(don't mind about tags, that'a a part of django template)

here is the script-part with table initialization:
[code]
$(document).ready(
function() {
var rtbl = $('#sreports_grid').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/api/reports/?type=sites",
"bFilter": false,
"bAutoWidth": false,
"bSearch": false,
"aoColumns": [
/* Site Name */ { "sClass": "center", "fnRender": function ( oObj ) {
return '' + oObj.aData[0] + ''
} },
/* Date */ { "sClass": "center" },
/* Impressions */ { "sClass": "center" },
/* Clicks */ { "sClass": "center" },
],
"sPaginationType": "full_numbers"
});
});
[/code]

response, accodring to fiddler (special for IE):
[code]
{"aaData": [["http://bk.ru", "2010-03-07", 31, 0], ["http://bk.ru", "2010-03-08", 15, 0], ["http://johndoe.com", "2010-03-07", 49, 0], ["http://johndoe.com", "2010-03-08", 12, 0]], "iTotalRecords": 4, "sEcho": "1", "iTotalDisplayRecords": 4} [/code]
request url from datatables;
[code]
/api/reports/?type=sites&sEcho=1&iColumns=5&sColumns=&iDisplayStart=0&iDisplayLength=10&iSortingCols=1&iSortCol_0=0&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=true&bSortable_4=true [/code]

any suggestions?

Replies

  • VidJaVidJa Posts: 1Questions: 0Answers: 0
    edited March 2010
    Did you find a solution? I have exactly the same problem, but on firefox and konquerer, also with Django and datatables. I checked the json, validates with json lint, table cols the same as the json cols.

    The weird thing is that if you change the show entries dropdown the page actually shows

    Showing 0 to 0 of 0 entries (filtered from 57 total entries)

    so some sort of processing has been done, but no error messages show.
    I tried recreating the example page, but now pointing at my Django view, that works flawless, so it must be somewhere in the xhtml source on the page.
  • psihonavtpsihonavt Posts: 4Questions: 0Answers: 0
    edited March 2010
    hello, VidJa!
    in my case resolution was very simple (JS-code "mistake")
    bad version of column declaration (bad for IE)
    [code]
    "aoColumns": [
    /* Site Name */ { "sClass": "center", "fnRender": function ( oObj ) {
    return '' + oObj.aData[0] + ''
    } },
    /* Date */ { "sClass": "center" },
    /* Impressions */ { "sClass": "center" },
    /* Clicks */ { "sClass": "center" },
    [/code]

    correct version:
    [code]
    "aoColumns": [
    /* Site Name */ { "sClass": "center", "fnRender": function ( oObj ) {
    return '' + oObj.aData[0] + ''
    } },
    /* Date */ { "sClass": "center" },
    /* Impressions */ { "sClass": "center" },
    /* Clicks */ { "sClass": "center" }
    [/code]
    the same as first time, but without trailing comma in the end of aoColumns list (IE's js-engine interprets this comma as fifth column)

    about your issue:
    can you provide json-response from the server and code of datatable initialization?
This discussion has been closed.