Splunk Search

When creating a statistical table using the table command, is there a way to disable sorting of data on click of table column headers?

nawneel
Communicator

When we create a statistical table using table command , is there a way to disable sorting of data on click of table column headers?

Tags (3)
0 Karma
1 Solution

vganjare
Builder

This can be done using a JS trick. Add following code in JS.

function disableSorting(){
    console.log('disableSorting called');
    jQuery(document).ready(function(){
        console.log($('.sorts').length);
        if($('.sorts').length == 0){
            setTimeout(function(){
                disableSorting();
            }, 500);
        }else{
            $('.sorts').each(function(){ 
                var elem = $(this); 
                elem.removeClass('sorts')
            });
        }
    });
}

function validateJQueryLoaded(){
    console.log('validateJQueryLoaded called');
    if (typeof jQuery === 'undefined') {
        setTimeout(function(){
            validateJQueryLoaded();
        }, 500);
    }else{
       disableSorting();
    }
}

validateJQueryLoaded();

Please Note: This JS has to be executed once the Data Table loads in the page.

Thanks!!

View solution in original post

vganjare
Builder

This can be done using a JS trick. Add following code in JS.

function disableSorting(){
    console.log('disableSorting called');
    jQuery(document).ready(function(){
        console.log($('.sorts').length);
        if($('.sorts').length == 0){
            setTimeout(function(){
                disableSorting();
            }, 500);
        }else{
            $('.sorts').each(function(){ 
                var elem = $(this); 
                elem.removeClass('sorts')
            });
        }
    });
}

function validateJQueryLoaded(){
    console.log('validateJQueryLoaded called');
    if (typeof jQuery === 'undefined') {
        setTimeout(function(){
            validateJQueryLoaded();
        }, 500);
    }else{
       disableSorting();
    }
}

validateJQueryLoaded();

Please Note: This JS has to be executed once the Data Table loads in the page.

Thanks!!

nawneel
Communicator

This is exactly what i was looking for, Thanks @Vganjare

0 Karma

MuS
SplunkTrust
SplunkTrust

Hi nawneel,

No, not by using Splunk internal features....But, you could do it using sideview utils like described in this answer from @sideview https://answers.splunk.com/answers/215137/prevent-users-from-table-sorting-when-clicking-on.html

cheers, MuS

0 Karma

nawneel
Communicator

Thanks for response @MuS
I do not intend to use sideviews utils.

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...