Javascript code in JSON data source not work in Safari/IE

Javascript code in JSON data source not work in Safari/IE

mathiemathie Posts: 36Questions: 0Answers: 0
edited November 2009 in Bug reports
Hello,

I use dynamic data loading via JSON/AJAX. For testing, I have a very simple, one row, one col. So the single data cell has an alert('ok');

In Firefox, it's expected, the dialog box pops up. In Safari, IE, nothing happens.

Please let me know if there is any special considerations for this case (like DataTables does any manipulation to the data)

Replies

  • mathiemathie Posts: 36Questions: 0Answers: 0
    I found what it is now. Since "nTd.innerHTML = sSomeStr;", I would need to use fnRender() to eval the JS code myself. It's around line 2040.
    [code]
    nTd = document.createElement('td');

    if ( typeof oSettings.aoColumns[i].fnRender == 'function' )
    {
    var sRendered = oSettings.aoColumns[i].fnRender( {
    "iDataRow": iThisIndex,
    "iDataColumn": i,
    "aData": aData,
    "oSettings": oSettings
    } );
    nTd.innerHTML = sRendered;
    if ( oSettings.aoColumns[i].bUseRendered )
    {
    /* Use the rendered data for filtering/sorting */
    oSettings.aoData[iThisIndex]._aData[i] = sRendered;
    }
    }
    else
    {
    nTd.innerHTML = aData[i];
    }
    [/code]
This discussion has been closed.