Getting current table settings

Getting current table settings

gd52gd52 Posts: 1Questions: 0Answers: 0
edited September 2012 in Feature requests
I need to save the current settings for pagelength, startdisplayitem and current filter.
I am currently digging them out of the DOM, but it would be nicer if there was a "sanctioned" way to do this.
Below is an example of what I have to do (using some custom DOM methods, but you should catch the drinf)

var odiv = document.getElementById("data_length");
var oSelect = $walk(odiv, "dd");
__p.pageLength = ml.dom.getValue(oSelect);

__p.pageStart = mainTable.DataTable.settings[0]._iDisplayStart;

var o = $el("data_filter");
o = ml.dom.walk(o, "dd");
__p.filter = ml.dom.getValue(o);

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    The fnPagingInfo plug-in ( http://datatables.net/plug-ins/api#fnPagingInfo ) is the way to do it for paging. There isn't currently an equivalent plug-in for filtering, but the data store object in DataTables is the oSearch parameter with this model: http://datatables.net/docs/DataTables/1.9.3/DataTable.models.oSearch.html - if anyone fancies creating a similar plug-in :-)

    Allan
This discussion has been closed.