Skip to content

Instantly share code, notes, and snippets.

@ryun
Last active August 29, 2015 14:22
Show Gist options
  • Save ryun/284e8f1321a22a56f2aa to your computer and use it in GitHub Desktop.
Save ryun/284e8f1321a22a56f2aa to your computer and use it in GitHub Desktop.
var customFilterData = {};
$('#data-table')
.on('preXhr.dt', function ( e, settings, d )
{
d.page = Math.ceil(d.start / d.length) + 1;
if ( d.page <= 1 ) d.page = 1;
for (var i in customFilterData)
{
d[i] = customFilterData[i];
}
}
)
$('.example-filter-button').on('click', function(e){
// Serialize fields
// Set them to customFilterData
// Trigger data tables filter request
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment