I have a SP 2010 list which I need to filter (with AJAX) based on multiple user requirements (dates, number of attendees, room requirements, etc), each corresponding to separate columns. Next, allow the user to select a remaining row which they want, and give them an option to select and update that row.
I am using SP Services to do the filtering, but only with a single criteria at the moment, but I do not know the best strategy to accomplish the rest of what I am trying to achieve here.
Below is the code I have for the filtering I have in place atm:
$(document).ready(function(){
$().SPServices({
operation: "GetListItems",
async: true,
debug: true,
listName: "Available_Rooms",
maxResults: 11,
CAMLRowLimit: 11,
completefunc: function (xData, Status) {
var JsonObject = $(xData.responseXML).SPFilterNode('z:row').SPXmlToJson({
mapping: {
ows_RoomCapacity: { mappedName: "RoomCapacity", objectType: "Number" }
},
includeAllAttrs: true,
removeOws: true,
sparse: true
});
$('#VTCAvailableRooms').dataTable({
"pageLength": 11,
"bAutoWidth": true,
"bDestroy": true,
"bProcessing": true,
"bLoadingRecords": 'Please wait - loading...',
"bFilter": true,
"deferRender": true,
"responsive": true,
"aaData": JsonObject,
"aoColumnDefs": [
{ "mData": "RoomCapacity", "aTargets": [ 0 ] },
{ "mData": "DisplayName", "aTargets": [ 1 ] },
{ "mData": "RoomDeptOwner", "aTargets": [ 2 ] },
{ "mData": "RoomType", "aTargets": [ 3 ] },
{ "mData": "Title", "aTargets": [ 4 ] },
{ "mData": "VTC", "aTargets": [ 5 ] },
{ "mData": "Projector", "aTargets": [ 6 ] }
]
});
}
});
});
I'm not asking for someone to solve my problem for me, but I'd love it if they could point me in the right direction or recommend some tools I could use to solve this that would be amazing! Thanks in advance.