scalatags optgroup label

19 views
Skip to first unread message

jvr...@googlemail.com

unread,
Jul 9, 2018, 9:10:59 AM7/9/18
to Scalatags
How can I set the label attribute in an scalatags optgroup?
i.e.

select(...
optgroup(label := "labeltext",
                                    option(value := ... ) ...

-> Expression does not convert to assignment because receiver is not assignable

jvr...@googlemail.com

unread,
Jul 14, 2018, 6:29:50 PM7/14/18
to Scalatags
Meanwhile I wrote this little helper function which does the job:

 def ChangeLabel (id: String, s: String, groupnumber: Int) = {
 
dom.document.getElementById(id).asInstanceOf[domhtml.Select].getElementsByTagName("optgroup")(groupnumber).asInstanceOf[domhtml.OptGroup].label = s
 
}
Reply all
Reply to author
Forward
0 new messages