Datatables - serverside proceccing - not working in IE7

Datatables - serverside proceccing - not working in IE7

kyennetikyenneti Posts: 8Questions: 0Answers: 0
edited May 2009 in Bug reports
I am trying datatables server_side processing - Its working great in firefox but not working in IE-7.
I tried both 1.5.beta.7 and 1.5.beta.8 .I am getting the following for the totals -I had total of 20 records.

Showing 1 to 0 of 20 entries ( on IE)
Showing 1 to 10 of 20 entries ( on firefox)

Replies

  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    Hi kyenneti,

    The most likely think here is that you have a trailing comma at the end of your data array. Firefox allows for this, while IE (I would say correctly in this regard, and I don't say that about IE often :-) ) does not and throws an error.

    Try passing your JSON return through www.jsonlint.com - a fantastic validator for JSON.

    Regards,
    Allan
  • kyennetikyenneti Posts: 8Questions: 0Answers: 0
    Thank you so much..That fixed it. I checked my return through firebug (another great utility like yours ) - My Output final field had a comma at the end.
    Again.Thank you for your plugin and support-
    Kalyan
  • cmanvacmanva Posts: 37Questions: 0Answers: 0
    edited May 2011
    I have the same issue, but the trailing comma is removed and my JSON data is valid. But when I run it on IE7, the screen is blank? It works great on Chrome and firefox. Any tips on what to look for?

    Note: classic asp

    code to strip:
    [code]
    if len(aaData) > 0 then
    aaData = Left(aaData,Len(aaData)-1)
    end if
    [/code]


    JSON data:
    [code]
    {
    "sEcho": 1,
    "iTotalRecords": 1,
    "iTotalDisplayRecords": 1,
    "aaData": [
    [
    "Towers Perrin and Watson Wyatt Complete Merger to Form Towers Watson Towers Watson & Co. announced today the completion of the merger of Towers Perrin and Watson Wyatt. The transaction to form Towers Watson, a leading global professional services company, was announced on June 28, 2009. Watson Wyatt Chief Executive Officer John Haley will serve as Towers Watson’s Chairman and Chief Executive Officer; Towers Perrin Chief Executive Officer Mark Mactas will serve as Deputy Chairman, President and Chief Operating Officer.",
    "January 03, 2010|GlobalShare|"
    ]
    ]
    }
    [/code]
  • cmanvacmanva Posts: 37Questions: 0Answers: 0
    Also, is there way to throw an alert message based on success or failure? Can anyone help with syntax?
  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    Your JSON is not valid: http://jsonlint.com/ . There is an unescaped quote which is causing the problem. DataTables 1.7+ will give an alert() to indicate this.

    Allan
  • cmanvacmanva Posts: 37Questions: 0Answers: 0
    I reformatted the JSON data, still getting the same issue? But, I noticed that something is getting pushed to the screen, but blank (footer getting pushed down the screen based on size of records returned)?
    Note:
    I'm getting this data from Chrome (XHR developer tools) and pasting it to http://www.jsonlint.com/ on an IE7 browser. Not sure if there's anything on the IE end to troubleshoot this?

    [code]
    {
    "sEcho": 1,
    "iTotalRecords": 1,
    "iTotalDisplayRecords": 1,
    "aaData": [
    [
    "Towers Perrin and Watson Wyatt Complete Merger \r\nto Form Towers Watson\r\nTowers Watson & Co. announced today the completion of the merger of Towers Perrin and Watson Wyatt. The transaction to form Towers Watson, a leading global professional services company, was announced on June 28, 2009. Watson Wyatt Chief Executive Officer John Haley will serve as Towers Watson’s Chairman and Chief Executive Officer; Towers Perrin Chief Executive Officer Mark Mactas will serve as Deputy Chairman, President and Chief Operating Officer.",
    "January 03, 2010|GlobalShare|"
    ]
    ]
    }
    [/code]
  • cmanvacmanva Posts: 37Questions: 0Answers: 0
    I figured it out..my javascript on the client side..I needed to remove a comma after my last parameter.
This discussion has been closed.