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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...