On change update search filter.
On change update search filter.
ministrypixel
Posts: 12Questions: 0Answers: 0
I have a set of links that are clickable. When a link is clicked, the value shows in search box. I am trying to get it where it will search the rows just like keyup changes results. Below is my code snippets. Thank you in advance for your help!
In datatables.js
[code] function _fnFeatureHtmlFilter ( oSettings )
{
var nFilter = document.createElement( 'div' );
if ( oSettings.sTableId !== '' && typeof oSettings.aanFeatures.f == "undefined" )
{
nFilter.setAttribute( 'id', oSettings.sTableId+'_filter' );
}
nFilter.className = oSettings.oClasses.sFilter;
var sSpace = oSettings.oLanguage.sSearch==="" ? "" : " ";
nFilter.innerHTML = oSettings.oLanguage.sSearch+sSpace+'Search: ';
var jqFilter = $("input", nFilter);
jqFilter.val( oSettings.oPreviousSearch.sSearch.replace('"','"') );
jqFilter.change(function(e) {
/* Update all other filter input elements for the new display */
var n = oSettings.aanFeatures.f;
for ( var i=0, iLen=n.length ; i
In datatables.js
[code] function _fnFeatureHtmlFilter ( oSettings )
{
var nFilter = document.createElement( 'div' );
if ( oSettings.sTableId !== '' && typeof oSettings.aanFeatures.f == "undefined" )
{
nFilter.setAttribute( 'id', oSettings.sTableId+'_filter' );
}
nFilter.className = oSettings.oClasses.sFilter;
var sSpace = oSettings.oLanguage.sSearch==="" ? "" : " ";
nFilter.innerHTML = oSettings.oLanguage.sSearch+sSpace+'Search: ';
var jqFilter = $("input", nFilter);
jqFilter.val( oSettings.oPreviousSearch.sSearch.replace('"','"') );
jqFilter.change(function(e) {
/* Update all other filter input elements for the new display */
var n = oSettings.aanFeatures.f;
for ( var i=0, iLen=n.length ; i
This discussion has been closed.
Replies
[code]
$('a.myFilter').click( function (e) {
e.preventDefault();
table.fnFilter( "myFilter..." );
} );
[/code]
Allan