Link to home
Start Free TrialLog in
Avatar of HyperBPP
HyperBPP

asked on

jquery datatables server side update to filter out inactive records

I have the following jQuery datatables initialization code and on the page
pTable = $('#myTable').dataTable({
					"bProcessing": true,
					"bServerSide": true,
					"bStateSave": false,
					"bAutoWidth:":false,
					"iDisplayLength":8,
					"sAjaxSource":"myServerSideScript”
					"bLengthChange": false
		}

Open in new window

Additionally I have a checkbox on the page above myTable that allows a user to see only records with an “active” status.  
 Only active <input id="active" onClick="showActive(this)" type="checkbox" name="selected">							   
		</form>

Open in new window

I’m not certain what dataTables API to use (if there is even one) to accomplish this.  Something like pTable.fnFilter(‘active’) but that keeps all the filtering and sorting already present in the table.  Is there a function to update the server side call but maintain the filtering and sorting?
Thanks!
ASKER CERTIFIED SOLUTION
Avatar of tjyoung
tjyoung

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of HyperBPP
HyperBPP

ASKER

Works a charm!  Thanks!
Thanks!  Works great!
Sure glad to help