cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
hotwheelzffx1
Nintex Newbie

Auto-check ALL list lookup options

Jump to solution

I have a List Lookup that is filtered by several cascading drop-downs.

How do I default to having all the options returned checked? I have searched the previous solutions but can't quite get them to work. I have tried giving the list lookup a CSS name and a Javascript client ID. In this case it's "TaskList". Untitled.png

This works when giving the user an option button to Select All.

NWF$('#'+TaskList).click(function(){
NWF$('input:checkbox').not(this).prop('checked', this.checked);
});

However, this info lives in a repeater row. Adding another repeater row breaks the Select All for that subsequent row.

 

I would like everything to just be auto-selected on load.

Labels: (1)
0 Kudos
Reply
3 Replies
hotwheelzffx1
Nintex Newbie

Re: Auto-check ALL list lookup options

Jump to solution

This ALMOST works. It does check the boxes, but the form doesn't save the results or values of the checked boxes.

 

NWF.FormFiller.Events.RegisterAfterReady(function(){ 

var myElement = document.querySelectorAll('input[type=checkbox]')[0];

var observer = new MutationObserver(function(mutations) {
   if (document.contains(myElement)) {
        console.log("Checkbox Added");         

        NWF$('input:checkbox').prop('checked', true);
    }
});

observer.observe(document, {attributes: false, childList: true, characterData: false, subtree:true});
});

0 Kudos
Reply
hotwheelzffx1
Nintex Newbie

Re: Auto-check ALL list lookup options

Jump to solution

Should also note that this only works in Microsoft Edge and Chrome.

0 Kudos
Reply
hotwheelzffx1
Nintex Newbie

Re: Auto-check ALL list lookup options

Jump to solution

This script works. The key is to trigger('click') on the selected option.

 

NWF.FormFiller.Events.RegisterAfterReady(function(){
var myElement = document.querySelectorAll('input[type=checkbox]')[0];
var count = 0
var observer = new MutationObserver(function(mutations) {
if (document.contains(myElement) && NWF$('input:checkbox').prop('checked', false)) {
// console.log("Checkbox Added");
NWF$('input[type=checkbox]').trigger('click');
//count++
//console.log(count);
}
});
observer.observe(document, {attributes: false, childList: true, characterData: true, subtree:true});
});

0 Kudos
Reply