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!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...