');
}
});
}
- function getAdvanceToolBar(){
+ function getAdvanceToolBar() {
if (!table.hasClass('no-toolbar')) {
if (table.hasClass('sorting-enabled')) {
return '
' +
- '' +
- '' +
- '' +
- '' +
- '
' + dropdownmenu[0].outerHTML + '
' +
- '
'
+ '' +
+ '' +
+ '' +
+ '' +
+ '
' + dropdownmenu[0].outerHTML + '
' +
+ ''
} else {
return '
' +
- '' +
- '' +
- '' +
- '' +
- '
'
+ '' +
+ '' +
+ '' +
+ '' +
+ ''
}
- }else{
+ } else {
return '';
}
}
@@ -184,22 +187,22 @@ $.fn.datatables_extended = function(settings){
/**
* sorting dropdown menu select function
*/
- $('.dataTables_wrapper .sort-list li a').click(function() {
+ $('.dataTables_wrapper .sort-list li a').click(function () {
$(this).closest('li').siblings('li').find('a').removeClass('sorting_asc').removeClass('sorting_desc');
var thisTable = $(this).closest('.dataTables_wrapper').find('.dataTable').dataTable();
if (!($(this).hasClass('sorting_asc')) && !($(this).hasClass('sorting_desc'))) {
$(this).addClass('sorting_asc');
- thisTable.fnSort( [ [$(this).attr('data-column'),'asc'] ] );
+ thisTable.fnSort([[$(this).attr('data-column'), 'asc']]);
}
- else if($(this).hasClass('sorting_asc')) {
+ else if ($(this).hasClass('sorting_asc')) {
$(this).switchClass('sorting_asc', 'sorting_desc');
- thisTable.fnSort( [ [$(this).attr('data-column'),'desc'] ] );
+ thisTable.fnSort([[$(this).attr('data-column'), 'desc']]);
}
- else if($(this).hasClass('sorting_desc')) {
+ else if ($(this).hasClass('sorting_desc')) {
$(this).switchClass('sorting_desc', 'sorting_asc');
- thisTable.fnSort( [ [$(this).attr('data-column'),'asc'] ] );
+ thisTable.fnSort([[$(this).attr('data-column'), 'asc']]);
}
});
@@ -216,44 +219,44 @@ $.fn.datatables_extended = function(settings){
$(button).addClass("active").html('Cancel');
$(button).parent().next().children("button").removeClass("disabled");
// EMM related code
- $(document).off('click','.viewEnabledIcon');
+ $(document).off('click', '.viewEnabledIcon');
//--- End of EMM related codes
- } else if ($(button).html() == 'Cancel'){
+ } else if ($(button).html() == 'Cancel') {
$('.bulk-action-row').addClass('hidden');
thisTable.removeClass("table-selectable");
$(button).addClass("active").html('Select');
$(button).parent().next().children().addClass("disabled");
// EMM related function
- $(document).on('click','.viewEnabledIcon',InitiateViewOption);
+ $(document).on('click', '.viewEnabledIcon', InitiateViewOption);
//--- End of EMM related codes
}
});
/**
* select/deselect all rows function
*/
- $('.dataTables_wrapper [data-click-event=toggle-selected]').click(function() {
+ $('.dataTables_wrapper [data-click-event=toggle-selected]').click(function () {
var button = this,
thisTable = $(this).closest('.dataTables_wrapper').find('.dataTable').dataTable();
- if(!$(button).hasClass('disabled')){
- if($(button).html() == 'Select All') {
- thisTable.api().rows().every(function () {
- $(this.node()).addClass(rowSelectedClass);
- $(button).html('Deselect All');
- });
- }
- else if($(button).html() == 'Deselect All') {
- thisTable.api().rows().every(function () {
- $(this.node()).removeClass(rowSelectedClass);
- $(button).html('Select All');
- });
- }
+ if ($(button).html() == 'Select All') {
+ $(button).html('Deselect All');
+ $('.bulk-action-row').removeClass('hidden');
+ thisTable.api().rows().every(function () {
+ $(this.node()).addClass(rowSelectedClass);
+ });
+ }
+ else if ($(button).html() == 'Deselect All') {
+ $('.bulk-action-row').addClass('hidden');
+ $(button).html('Select All');
+ thisTable.api().rows().every(function () {
+ $(this.node()).removeClass(rowSelectedClass);
+ });
}
});
/**
* on row click select/deselect row function
*/
- $('body').on('click', '[data-type=selectable]', function(){
+ $('body').on('click', '[data-type=selectable]', function () {
var rowSelectedClass = 'DTTT_selected selected';
$(this).toggleClass(rowSelectedClass);
if ($('.table-selectable .DTTT_selected').length > 0) {
@@ -265,8 +268,9 @@ $.fn.datatables_extended = function(settings){
thisTable = $(this).closest('.dataTables_wrapper').find('.dataTable').dataTable();
thisTable.api().rows().every(function () {
- if(!$(this.node()).hasClass(rowSelectedClass)){
- $(button).closest('.dataTables_wrapper').find('[data-click-event=toggle-selected]').html('Select All');
+ if (!$(this.node()).hasClass(rowSelectedClass)) {
+ $(button).closest('.dataTables_wrapper').find('[data-click-event=toggle-selected]').
+ html('Select All');
}
});
});
@@ -275,8 +279,8 @@ $.fn.datatables_extended = function(settings){
* list table list/grid view toggle function
*/
var toggleButton = $('[data-click-event=toggle-list-view]');
- toggleButton.click(function(){
- if($(this).attr('data-view') == 'grid') {
+ toggleButton.click(function () {
+ if ($(this).attr('data-view') == 'grid') {
$(this).closest('.dataTables_wrapper').find('.dataTable').addClass('grid-view');
//$(this).closest('li').hide();
//$(this).closest('li').siblings().show();
@@ -288,7 +292,7 @@ $.fn.datatables_extended = function(settings){
}
});
}
- },settings)
+ }, settings)
);
};
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 c79bd99516..836bef71cb 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
@@ -50,12 +50,12 @@ $.fn.datatables_extended_serverside_paging = function (settings, url, dataFilter
var deviceType;
var ownership;
- var searching = true;
- if (options) {
- if (typeof options.searching !== 'undefined') {
- searching = options.searching;
- }
- }
+ var searching = true;
+ if (options) {
+ if (typeof options.searching !== 'undefined') {
+ searching = options.searching;
+ }
+ }
//--- End of EMM related codes
@@ -190,7 +190,8 @@ $.fn.datatables_extended_serverside_paging = function (settings, url, dataFilter
});
} else if (filterColumn.eq(column.index()).hasClass('text-filter')) {
var title = filterColumn.eq(column.index()).attr('data-for');
- $(filterColumn.eq(column.index()).empty()).html('');
+ $(filterColumn.eq(column.index()).empty()).html('');
//noinspection SpellCheckingInspection
filterColumn.eq(column.index()).find('input').on('keyup', function () {
@@ -211,10 +212,12 @@ $.fn.datatables_extended_serverside_paging = function (settings, url, dataFilter
*/
var table = this;
if (table.hasClass('sorting-enabled')) {
- var dropdownmenu = $('