Move Dropdown filters from Header/Footer area to another table.
Move Dropdown filters from Header/Footer area to another table.
I have followed the following example: https://www.datatables.net/beta/1.8/examples/api/regex.html and it works great, but I need to turn the text box inputs to select dropdown lists that are in located in another table. I am currently using version 1.10.10 for this solution. I have read through the column.data() documentation, but my javascript is not very good and I do not know how to get the data to go where I need it.... I can not use the filters in the columns as I only need to show 6 columns, but I need to filter on ~15 fields in total. what you see below is a snippet of my current code. It would be great if I could get the other dropdowns to reduce there selections based on ones that have already been selected as well.
I am currently getting the data from a SharePoint 2013 list using an AJAX call list this:
'''$(document).ready(function () {
$.ajax({
url: "/mysite/_api/Web/Lists/GetByTitle('oil')/items",
type: 'GET',
dataType: 'JSON',
headers: {
Accept: "application/json;odata=verbose"
},
success: function (data,textStatus, jqXHR) {
var Otable = $('#example').dataTable({
"bProcessing": true,
"sScrollY": "500px",
"colReorder": true,
"fixedHeader": true,
"responsive": true,
"keys": true,
"bStateSave": false,
"bDestroy": true,
"aaData": data.d.results,
"aoColumns": [
{ "mData": "ID" },
{ "mData": "Title_x002f_Screen" },
{ "mData": "Title" },
{ "mData": "Description" },
{ "mData": "Status"},
{ "mData": "EditItem" },
{ "mData": "Function", "bVisible": false,"bSearchable": true}
],
});
$("#global_filter").keyup( fnFilterGlobal );
$("#col1_filter").keyup( function() { fnFilterColumn( 0 ); } );
$("#col2_filter").keyup( function() { fnFilterColumn( 1 ); } );
$("#col3_filter").keyup( function() { fnFilterColumn( 2 ); } );
$("#col4_filter").keyup( function() { fnFilterColumn( 3 ); } );
$("#col5_filter").keyup( function() { fnFilterColumn( 4 ); } );
$("#col6_filter").keyup( function() { fnFilterColumn( 5 ); } );
$("#col7_filter").keyup( function() { fnFilterColumn( 6 ); } );
},
error: function () {
alert("Error");
},
})
});
'''
Any Help you can add would be great. Thank you in advance.