嗨我想在grails中動態創建一個只強調某些選項標籤的下拉列表。以下是我有:Grails選擇標籤:添加樣式到特定的選項
<g:select class="DropDownList"
from="${listOfMaps}"
optionValue="${{(it.match=='Something'?'<em>':'') + it.thingToPrint
+ (it.match=='Something'?'</em>':'') }}"
/>
和這部作品在某種意義上說,它會打印打印的東西,但是當它是假設添加<em>
標籤是打印這樣的:
<option><em>ITEM</em></option>
這不是我所需要的。在下拉列表中打印<em>ITEM</em>
。
有誰知道如何得到它是這個:
<option><em>ITEM</em></option>
,這樣它會打印「項目」?
,我迄今所使用的資源:
相關:http://stackoverflow.com/questions/5976941/grails-gselect-tag –