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!
JavaScriptAJAXjQuery

Avatar of undefined
Last Comment
tjyoung

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
tjyoung

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
HyperBPP

ASKER
Works a charm!  Thanks!
HyperBPP

ASKER
Thanks!  Works great!
tjyoung

Sure glad to help
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy