dojo – 以粗体和字体添加到dijit / form /选择以编程方式

前端之家收集整理的这篇文章主要介绍了dojo – 以粗体和字体添加到dijit / form /选择以编程方式前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
嗨如何在dijit / form / select中以编程方式为每个选项添加粗体和字体大小等样式?

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",{label:"Mk10DC Card",value:"testdata2060_03",{label:"Mk6BC Card",value:"dbProdigy",{label:"Mk6NBC Card",value:"dbProdigy_MK6N",],style:{width:'250px'}
},"select_Card");

select_Card.startup();
    });
    });

请指教
谢谢
克莱门特

解决方法

在json中设置标签样式.

require(["dojo/ready","dijit/form/Select"],function(ready,Select){
ready(function(){ 
  var select_Card = new Select({
    options:[
     {label:"Select Card",{label:"<b>Mk7ABC Card</b>",{label:"<span style='color:red;'>Mk7CBC Card</span>",style:{width:'250px'}
  },"select_Card");
  select_Card.startup();
});
});

http://jsfiddle.net/cswing/udJuv/

猜你在找的Dojo相关文章