Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var oTable = $('.display').dataTable({
- "bJQueryUI": true,
- "oLanguage": {
- "sSearch": "Search all columns:"
- },
- "sDom": '<"H"lfr<"toolbar">>t<"clear"><"F" ip>',
- "bProcessing": true,
- "bJQueryUI": true,
- "sPaginationType": "full_numbers",
- "bServerSide": true,
- "sAjaxSource": "/Home/TableData",
- "fnServerData": function (sSource, aoData, fnCallback) {
- /* Add some extra data to the sender */
- aoData.push({ "name": "dateStart", "value": $("#startDateInput").attr('value') });
- aoData.push({ "name": "dateEnd", "value": $("#endDateInput").attr('value') });
- aoData.push({ "name": "showing", "value": $("#showingSelect").attr('value') });
- aoData.push({ "name": "health_sort", "value": $("#search_health").val() });
- aoData.push({ "name": "rand", "value": (Math.random() * 11) });
- $.getJSON(sSource, aoData, function (json) {
- /* Do whatever additional processing you want on the callback, then tell DataTables */
- fnCallback(json);
- //this has been placed here, as a separate fucntion and before fnCallback, all do not work
- $(".dataTables_filter input").attr('value', json.search);
- });
- },
- "aoColumns": [
- { "mDataProp": "details" },
- { "mDataProp": "organization" },
- { "mDataProp": "system" },
- { "mDataProp": "classification" },
- { "mDataProp": "slm" },
- { "mDataProp": "lifecycle" },
- { "mDataProp": "date_created" },
- { "mDataProp": "project_health_html" }
- ]
- });
Add Comment
Please, Sign In to add comment