MT#4287 Remove datatables state on menu items

That is, when changing the main pages (controller more or
less) like from /reseller to /contact, remove previous
stored state.
agranig/rest
Gerhard Jungwirth 12 years ago committed by Andreas Granig
parent cd0fa24e7d
commit 6583c96b51

@ -25,6 +25,11 @@ $.extend( $.fn.dataTableExt.oStdClasses, {
} );
$(document).ready(function() {
var prev_controller = document.referrer.match(/:\/\/[^/]*\/([^/]+)/).pop();
var this_controller = window.location.pathname.match(/[^/]+/g)[0];
if (prev_controller != this_controller) {
localStorage.removeItem('ngcp_dt_[% helper.id_from_name %]_table');
}
var [% helper.id_from_name %]_table = $('#[% helper.id_from_name %]_table')
.dataTable( {
"sDom": "<'row-fluid ngcp_dt_top_elements'lf<r>>t<'row-fluid'<'pull-left'i><'pull-right'p>>",

Loading…
Cancel
Save