本文介绍了添加粗体和字体到dijit / form /选择程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在dijit / form / select程序中为每个选项添加粗体和字体大小的样式?
Hi How do I add style such as bold and font size to each option in dijit/form/select programatically?
ready(function()//This function won't run until the DOM has loaded and other modules that register have run
{
parser.parse();
var select_Card = new Select
({options:
[
{label:"Select Card", value:"", selected:true},
{label:"Mk7ABC Card", value:"testdata1970_05", selected:false},
{label:"Mk7CBC Card", value:"testdata1970_10", selected:true},
{label:"Mk10DC Card", value:"testdata2060_03", selected:false},
{label:"Mk6BC Card", value:"dbProdigy", selected:false},
{label:"Mk6NBC Card", value:"dbProdigy_MK6N", selected:false},
], style:{width:'250px'}
}, "select_Card");
select_Card.startup();
});
});
请指教
感谢
Clement
Please advise ThanksClement
推荐答案
在json中设置标签样式。
Style the label inside your json.
require(["dojo/ready", "dijit/form/Select"], function(ready, Select){
ready(function(){
var select_Card = new Select({
options:[
{label:"Select Card", value:"", selected:true},
{label:"<b>Mk7ABC Card</b>", value:"testdata1970_05", selected:false},
{label:"<span style='color:red;'>Mk7CBC Card</span>",
value:"testdata1970_10", selected:true},
{label:"Mk10DC Card", value:"testdata2060_03", selected:false},
{label:"Mk6BC Card", value:"dbProdigy", selected:false},
{label:"Mk6NBC Card", value:"dbProdigy_MK6N", selected:false},
], style:{width:'250px'}
}, "select_Card");
select_Card.startup();
});
});
这篇关于添加粗体和字体到dijit / form /选择程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!