All Apps and Add-ons

CheckboxGroupView - check all

OL
Communicator

Hello,

I'm currently working with the splunk web framework in v6 and I'm using the CheckboxGroupView. I'd like to know if there is a way to check all checkboxes a the same time with this object.

So far I can use a javascript to do a check all as below, but the CheckboxGroupView object isn't refreshed (we can see that it is ticked, but the object underneath isn't set accordingly):

$(':checkbox').each(function() {
    this.checked = $that.is(':checked');
});

Do you know if there is another way to do a tick all? or a way to refresh CheckboxGroupView object?

Regards,
Olivier

0 Karma

peter_krammer
Communicator

If you use a $token$ with your CheckboxGroupView you could change the token, and the underlying object will update.

0 Karma

dfoster_splunk
Splunk Employee
Splunk Employee

Out of curiousity, does your CheckboxGroupView consist of only a static set of choices or is it being populated by a search?

0 Karma

ineeman
Splunk Employee
Splunk Employee

There is no current simple method to do this, though this is not a bad idea. We'll track this internally as a feature request (both check all and uncheck all).

In the interim, you could do this by selecting all the values manually. The trouble is in getting all the possible values. The only current way is to use something like jQuery to find all the choice elements and get their value tag, but this is not guaranteed to be forwards-compatible if we change the underlying internal markup.

0 Karma

OL
Communicator

Hello Ineeman,

Thank you very much for your reply. I have used JQuery indeed to tick them as mentioned above, but the underlying objects are not refresh. However, I have noticed that if I untick one and then tick it again, all objects underneath gets updated! So this is a work around for me at the moment.

Thanks again.

0 Karma
Get Updates on the Splunk Community!

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, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...