Not applicable

Implement optgroup in Lookup dropdown list

Jump to solution

Hi guys,

 

I have a Nintex Form which has a lookup field which is shown as dropdown. I have to insert optgroups in this lookup dropdown.

Please suggest any way to achieve this.

 

Thanks,

Ratnesh

0 Kudos
Reply
2 Replies
pfudala
Nintex Newbie

Re: Implement optgroup in Lookup dropdown list

Jump to solution

Hi Ratnesh Garg,

 

You will be able to achieve this via JavaScript.

I tested it with a lookup list as below:

 

And here is my code, set in the form settings :

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

  $(".select-with-optgroups").find("option[data-nfchoicevalue$='1']").wrapAll("<optgroup label='Ends with 1'></optgroup>");

  $(".select-with-optgroups").find("option[data-nfchoicevalue$='2']").wrapAll("<optgroup label='Ends with 2'></optgroup>");

  $(".select-with-optgroups").find("option[data-nfchoicevalue$='3']").wrapAll("<optgroup label='Ends with 3'></optgroup>");

});

 

 

And the result :

Hope this helps

View solution in original post

0 Kudos
Reply
Not applicable

Re: Implement optgroup in Lookup dropdown list

Jump to solution

Thanks Pierre,

I will try this and let you know if it works.

0 Kudos
Reply