DataTable.ext.iApiIndex is always 0?

DataTable.ext.iApiIndex is always 0?

RoyLingRoyLing Posts: 26Questions: 0Answers: 0
edited December 2012 in General
I see DataTable.ext.iApiIndex is not assigned/set anywhere, but it's used from other functions as the index of this table:
[code]
/**
* Index for what 'this' index API functions should use
* @type int
* @default 0
*/
"iApiIndex": 0,
[/code]

It's used like this:
[code]
var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );
[/code]

So, http://jsfiddle.net/royling/uNvT4/7/ - I only get the result as 4 instead of 8.

Allan,

Can you help?

Regards,
Roy

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    It is always 0 unless you change it - DataTables itself currently does not override it.

    If you want all of the cells from the tables you've need to change iApiIndex, or get the DataTables object for each table instance individually.

    DataTables 1.10's new API is going to significantly change this - it will work over multiple tables by default, much as you are expecting in your demo. The 1.9- API is rather deficient in this area and one of the reasons for the new API being developed :-)

    Allan
  • RoyLingRoyLing Posts: 26Questions: 0Answers: 0
    Thanks for your explanation and really look forward to the new release 1.10 to check out the significant update and meantime I wonder if 1.10 is backward compatible or not?
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Yes - there will be a shim layer which provides backwards compatibility :-). The current API should be fully supported. In fairness I haven't implemented it yet, so it is possible I'll come across something that is impossible to reimplement, but I don't think so - I haven't come across anything in the planning...

    Allan
This discussion has been closed.