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!

The OpenTelemetry Certified Associate (OTCA) Exam

What’s this OTCA exam? The Linux Foundation offers the OpenTelemetry Certified Associate (OTCA) credential to ...

From Manual to Agentic: Level Up Your SOC at Cisco Live

Welcome to the Era of the Agentic SOC   Are you tired of being a manual alert responder? The security ...

Splunk Classroom Chronicles: Training Tales and Testimonials (Episode 4)

Welcome back to Splunk Classroom Chronicles, our ongoing series where we shine a light on what really happens ...