vudaltsov - DataTables 1.10 issue

vudaltsov - DataTables 1.10 issue

allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
edited February 2014 in General
Reposted from the 1.10.0-beta.1 announcement thread.

here's a link to a strange, but simple example with 1.9.4: http://vudaltsov.ru/dataTable/dataTablesTest.php?ver=1.9.4

the same code with 1.10.0 files:
http://vudaltsov.ru/dataTable/dataTablesTest.php?ver=1.10.0

Replies

  • vudaltsovvudaltsov Posts: 3Questions: 0Answers: 0
    Oh, I'm sorry for being unattentive.
    I will repeat the problem here:

    It seems that 'mData': function (source, type, val) { ... } gives an empty val inside the function. Same code works great on 1.9.4 (visit the links from the post above)
  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Thanks for flagging this up.

    So the problem here is that in 1.10 we need to do a get on the data before we can set it! It is the get that is failing at the moment.

    This is a relatively simple fix in your code, just add a chance for `! type` and if that is true, then return the entire data source:

    [code]
    if (type === 'set')
    {
    var col = val.split('|');
    source.int = col[0];
    source.sel = col[1];
    return
    }
    else if (type === 'display') return source.sel;
    else if (!type) return source;
    return source.int;
    [/code]

    Unfortunately, I don't think this is something I can really fix to make it work like 1.9- since 1.9 was actually incorrect in this regard... Its a bug fix basically.

    Allan
This discussion has been closed.