Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35271

Array.prototype and DataTable.Api

$
0
0

The problem is quite exotic, however may be applicable to some cases, like mine.

Supposing I have another module, that extends the functionality of JavaScript arrays with extra functions, e.g. defines functions like Array.prototype.shuffle(). Now looking at DataTables code I see that some of the functions are populated from Array.prototype space (join(), pop(), push()), some are provided with optional implementation (filter() indexOf(), map()).

Combining two above is not pretty simple as from one side I don't want to many code lines like this:

$.fn.dataTable.Api.prototype.shuffle = Array.prototype.shuffle;

from another side populating whole Array.prototype to DataTable.Api may perhaps break DataTables. Maybe it would make sense to copy all Array.prototype to DataTable.Api but shield / add functions which are needed for correct DataTables functioning?

P.S. Calling toArray() is not best option for me, as number of rows is huge.


Viewing all articles
Browse latest Browse all 35271

Trending Articles