Datatables 1.9.4-- stop running script error on IE

Datatables 1.9.4-- stop running script error on IE

anandpatil343anandpatil343 Posts: 13Questions: 0Answers: 0
edited February 2014 in DataTables 1.9
I am using version 1.9.4 in my application, user is constantly getting stop running the script error on IE (8,9 etc)...

I have used the IE profiler , I have the below results : (some of the functions)

Function Count InclusiveTime (ms) ExclusiveTime (ms) AvgTime MaxTime
JScript - window script block 44,905 50,248.39 41,951.78 1.12 19,733.74
Array.unshift 1,447,666 7,249.77 7,249.77 0.01 343.74
initDataTable 1 57,201.30 6,827.91 57,201.30 57,201.30
initCreatedLeadsDataTable 1 62,888.61 5,687.32 62,888.61 62,888.61
pt 44,904 1,046.84 1,046.84 0.02 218.74
browserHandler 7 62,997.98 93.75 8,999.71 62,888.61
Array.sort 1 50,295.27 46.87 50,295.27 50,295.27
DataTable 1 50,373.39 15.62 50,373.39 50,373.39
String.replace 42 15.62 15.62 0.37 15.62

I need to know what is this array.unshift , why is taking being called so much time.
Need your assistance to resolve this error.

Replies

  • anandpatil343anandpatil343 Posts: 13Questions: 0Answers: 0
    Hi Team,

    Expecting some response on this, need your assistance.
  • anandpatil343anandpatil343 Posts: 13Questions: 0Answers: 0
    I found that this is happening on IE* , on other versions, data is getting loaded but on sorting it chokes.

    In IE8, I get the pop up on the below line of code:

    this.each(function () {
    var i = 0, iLen, j, jLen, k, kLen;
    var sId = this.getAttribute('id');
    var bInitHandedOff = false;
    var bUsePassedData = false;


    /* Sanity check */
    if (this.nodeName.toLowerCase() != 'table') {
    _fnLog(null, 0, "Attempted to initialise DataTables on a node which is not a " +
    "table: " + this.nodeName);
    return;
    }

    I guess something to do with too much of looping.
  • allanallan Posts: 63,489Questions: 1Answers: 10,469 Site admin
    1. Please post a test case showing the issues as required in the forum rules. We need a lot more details to be able to answer.

    2. Try using the latest version of DataTables (1.10.0-beta.3) which has some performance improvements.

    Allan
  • anandpatil343anandpatil343 Posts: 13Questions: 0Answers: 0
    Hi Allan,

    Thanks for your reply (phewww.. :)..)

    I am new to this portal, by test case you mean you need a link or something replicating the issue?.

    Can I safely use the 1.10.0-beta.3 version on my prod environment?

    Also, does this datatables.js require some particular version of jquery?

    Waitin for your response!!.
  • anandpatil343anandpatil343 Posts: 13Questions: 0Answers: 0
    I commented below lines of code while debugging, it runs fine then though table is getting re initialised everytime. But definitely it shows the instructions are crossing the browsers limit.

    /* Check to see if we are re-initialising a table */
    for (i = 0, iLen = DataTable.settings.length; i < iLen; i++) {
    /* Base check on table node */
    if (DataTable.settings[i].nTable == this) {
    if (oInit === undefined || oInit.bRetrieve) {
    return DataTable.settings[i].oInstance;
    }
    else if (oInit.bDestroy) {
    DataTable.settings[i].oInstance.fnDestroy();
    break;
    }
    else {
    _fnLog(DataTable.settings[i], 0, "Cannot reinitialise DataTable.\n\n" +
    "To retrieve the DataTables object for this table, pass no arguments or see " +
    "the docs for bRetrieve and bDestroy");
    return;
    }
    }

    /* If the element we are initialising has the same ID as a table which was previously
    * initialised, but the table nodes don't match (from before) then we destroy the old
    * instance by simply deleting it. This is under the assumption that the table has been
    * destroyed by other methods. Anyone using non-id selectors will need to do this manually
    */
    if (DataTable.settings[i].sTableId == this.id) {
    DataTable.settings.splice(i, 1);
    break;
    }
    }
  • anandpatil343anandpatil343 Posts: 13Questions: 0Answers: 0
    I found that the function fnDestroy() is the culprit , anything in this I can do to improve the speed.
  • anandpatil343anandpatil343 Posts: 13Questions: 0Answers: 0
    Hi Allan,

    One observation, I commented the below line in fndestroy method and things got working now.

    /* Blitz all DT events */
    //$(oSettings.nTableWrapper).find('*').andSelf().unbind('.DT');

    I don't no what is the impact of commenting this line, need your inputs on this please..
  • anandpatil343anandpatil343 Posts: 13Questions: 0Answers: 0
    Hi Allan,

    Any thoughts on the above.
  • allanallan Posts: 63,489Questions: 1Answers: 10,469 Site admin
    > Any thoughts on the above.

    Please don't bump posts. I'm providing free support as much as possible here.

    > I am new to this portal, by test case you mean you need a link or something replicating the issue?.

    Yes - link to the page, or use JSFiddle or similar to replicate the problem. Without being able to reproduce the issue I am just guessing and wasting everybody's time.

    > Can I safely use the 1.10.0-beta.3 version on my prod environment?

    That is up to you to decide. I do - but only you can say for you use case.

    > Also, does this datatables.js require some particular version of jquery?

    1.7 or newer.

    > //$(oSettings.nTableWrapper).find('*').andSelf().unbind('.DT');

    That line of code is _very_ slow. I've altered it in 1.10 to be much faster.

    Allan
  • anandpatil343anandpatil343 Posts: 13Questions: 0Answers: 0
    Ok thanks allan, will use your new version and let you know the outcome.
  • anandpatil343anandpatil343 Posts: 13Questions: 0Answers: 0
    Good morning Allan,

    I used the 1.10 beta version (on test environment), I see the speed has boosted up but have one problem.

    The header columns are being shown twice due to which sorting is choking (I guess this is due to double headers) , any pointers on this would be helpful.
  • anandpatil343anandpatil343 Posts: 13Questions: 0Answers: 0
    Hi Allan,

    Awaiting your inputs...
  • anandpatil343anandpatil343 Posts: 13Questions: 0Answers: 0
    Hi Allan,

    Been a while, did you get a chance to look into this?
  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Allan has asked you twice to provide a link to a test case.
  • allanallan Posts: 63,489Questions: 1Answers: 10,469 Site admin
    Yup - the forum rules are _very_ clear. Please post a link to a test case. Without it I cannot offer any help beyond what I already have. Please help me to help you.
  • anandpatil343anandpatil343 Posts: 13Questions: 0Answers: 0
    Ok thanks.
This discussion has been closed.