From 4fe79be5f8c205c3274de780fcb10ed38209f170 Mon Sep 17 00:00:00 2001 From: dilanua Date: Thu, 8 Sep 2016 22:44:18 +0530 Subject: [PATCH] Updating datatables server-side-paging module --- .../dataTables.extended.serversidepaging.js | 48 +++++++++---------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.serversidepaging.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.serversidepaging.js index 8b6c1e3b71..3b2fddb195 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.serversidepaging.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.serversidepaging.js @@ -72,13 +72,13 @@ $.fn.datatables_extended_serverside_paging = function (settings , url, dataFilte responsive: false, autoWidth: false, dom:'<"dataTablesTop"' + - 'f' + - '<"dataTables_toolbar">' + - '>' + - 'rt' + - '<"dataTablesBottom"' + - 'lip' + - '>', + 'f' + + '<"dataTables_toolbar">' + + '>' + + 'rt' + + '<"dataTablesBottom"' + + 'lip' + + '>', language: { searchPlaceholder: options.placeholder, search: '' @@ -103,17 +103,18 @@ $.fn.datatables_extended_serverside_paging = function (settings , url, dataFilte ); column - //.search(val ? '^' + val + '$' : '', true, false) + //.search(val ? '^' + val + '$' : '', true, false) .search(val ? val : '', true, false) .draw(); if (filterColumn.eq(column.index()).hasClass('data-platform')) { - if (val == null || val == undefined || val == "") { - $("#operation-bar").hide(); - $("#operation-guide").show(); + if (!val) { + $("#operation-bar").addClass("hidden"); + $("#operation-guide").removeClass("hidden"); } else { - $("#operation-guide").hide(); - $("#operation-bar").show(); + $("#operation-guide").addClass("hidden"); + $("#operation-bar").removeClass("hidden"); + //noinspection JSUnresolvedFunction loadOperationBar(val); } } @@ -141,13 +142,9 @@ $.fn.datatables_extended_serverside_paging = function (settings , url, dataFilte var title = filterColumn.eq(column.index()).attr('data-for'); $(filterColumn.eq(column.index()).empty()).html(''); + //noinspection SpellCheckingInspection filterColumn.eq(column.index()).find('input').on('keyup change', function () { column.search($(this).val()).draw(); - if ($('.dataTables_empty').length > 0) { - $('.bulk-action-row').addClass("hidden"); - } else { - $('.bulk-action-row').removeClass("hidden"); - } }); } @@ -173,13 +170,13 @@ $.fn.datatables_extended_serverside_paging = function (settings , url, dataFilte * append advance operations to list table toolbar */ $('.dataTable.list-table').closest('.dataTables_wrapper').find('.dataTablesTop .dataTables_toolbar').html('' + - '' + '' ); /** @@ -285,5 +282,4 @@ $.fn.datatables_extended_serverside_paging = function (settings , url, dataFilte } },settings) ); - };