js代码
<script type="text/javascript">
dojo.require("dijit.form.FilteringSelect");
dojo.require("dojo.data.ItemFileReadStore");
</script>
<script type="text/javascript">
dojo.addOnLoad(function() {
var stateStore = new dojo.data.ItemFileReadStore({
url: "http://docs.dojocampus.org/moin_static163/js/dojo/trunk/dijit/tests/_data/states.json"
});
var filteringSelect = new dijit.form.FilteringSelect({
id: "stateSelect",
name: "state",
value: "KY",
store: stateStore,
searchAttr: "name"
},
"stateSelect");
});
</script>
html代码
<input id="stateSelect">
<p>
<button onClick="alert(dijit.byId('stateSelect').attr('value'))">
Get value
</button>
</p>
json数据
{
identifier:"abbreviation",
label: "name",
items: [
{name:"Alabama", label:"<img width='97px' height='127px' src='images/Alabama.jpg'/>Alabama",abbreviation:"AL"},
{name:"Alaska", label:"Alaska",abbreviation:"AK"},
{name:"American Samoa", label:"American Samoa",abbreviation:"AS"},
{name:"Arizona", label:"Arizona",abbreviation:"AZ"},
{name:"Arkansas", label:"Arkansas",abbreviation:"AR"},
{name:"Armed Forces Europe", label:"Armed Forces Europe",abbreviation:"AE"},
{name:"Armed Forces Pacific", label:"Armed Forces Pacific",abbreviation:"AP"},
{name:"Armed Forces the Americas", label:"Armed Forces the Americas",abbreviation:"AA"},
{name:"California", label:"California",abbreviation:"CA"},
{name:"Colorado", label:"Colorado",abbreviation:"CO"},
{name:"Connecticut", label:"Connecticut",abbreviation:"CT"},
{name:"Delaware", label:"Delaware",abbreviation:"DE"},
{name:"District of Columbia", label:"District of Columbia",abbreviation:"DC"},
{name:"Federated States of Micronesia", label:"Federated States of Micronesia",abbreviation:"FM"},
{name:"Florida", label:"Florida",abbreviation:"FL"},
{name:"Georgia", label:"Georgia",abbreviation:"GA"},
{name:"Guam", label:"Guam",abbreviation:"GU"},
{name:"Hawaii", label:"Hawaii",abbreviation:"HI"},
{name:"Idaho", label:"Idaho",abbreviation:"ID"},
{name:"Illinois", label:"Illinois",abbreviation:"IL"},
{name:"Indiana", label:"Indiana",abbreviation:"IN"},
{name:"Iowa", label:"Iowa",abbreviation:"IA"},
{name:"Kansas", label:"Kansas",abbreviation:"KS"},
{name:"Kentucky", label:"Kentucky",abbreviation:"KY"},
{name:"Louisiana", label:"Louisiana",abbreviation:"LA"},
{name:"Maine", label:"Maine",abbreviation:"ME"},
{name:"Marshall Islands", label:"Marshall Islands",abbreviation:"MH"},
{name:"Maryland", label:"Maryland",abbreviation:"MD"},
{name:"Massachusetts", label:"Massachusetts",abbreviation:"MA"},
{name:"Michigan", label:"Michigan",abbreviation:"MI"},
{name:"Minnesota", label:"Minnesota",abbreviation:"MN"},
{name:"Mississippi", label:"Mississippi",abbreviation:"MS"},
{name:"Missouri", label:"Missouri",abbreviation:"MO"},
{name:"Montana", label:"Montana",abbreviation:"MT"},
{name:"Nebraska", label:"Nebraska",abbreviation:"NE"},
{name:"Nevada", label:"Nevada",abbreviation:"NV"},
{name:"New Hampshire", label:"New Hampshire",abbreviation:"NH"},
{name:"New Jersey", label:"New Jersey",abbreviation:"NJ"},
{name:"New Mexico", label:"New Mexico",abbreviation:"NM"},
{name:"New York", label:"New York",abbreviation:"NY"},
{name:"North Carolina", label:"North Carolina",abbreviation:"NC"},
{name:"North Dakota", label:"North Dakota",abbreviation:"ND"},
{name:"Northern Mariana Islands", label:"Northern Mariana Islands",abbreviation:"MP"},
{name:"Ohio", label:"Ohio",abbreviation:"OH"},
{name:"Oklahoma", label:"Oklahoma",abbreviation:"OK"},
{name:"Oregon", label:"Oregon",abbreviation:"OR"},
{name:"Pennsylvania", label:"Pennsylvania",abbreviation:"PA"},
{name:"Puerto Rico", label:"Puerto Rico",abbreviation:"PR"},
{name:"Rhode Island", label:"Rhode Island",abbreviation:"RI"},
{name:"South Carolina", label:"South Carolina",abbreviation:"SC"},
{name:"South Dakota", label:"South Dakota",abbreviation:"SD"},
{name:"Tennessee", label:"Tennessee",abbreviation:"TN"},
{name:"Texas", label:"Texas",abbreviation:"TX"},
{name:"Utah", label:"Utah",abbreviation:"UT"},
{name:"Vermont", label:"Vermont",abbreviation:"VT"},
{name: "Virgin Islands, U.S.",label:"Virgin Islands, U.S.",abbreviation:"VI"},
{name:"Virginia", label:"Virginia",abbreviation:"VA"},
{name:"Washington", label:"Washington",abbreviation:"WA"},
{name:"West Virginia", label:"West Virginia",abbreviation:"WV"},
{name:"Wisconsin", label:"Wisconsin",abbreviation:"WI"},
{name:"Wyoming", label:"Wyoming",abbreviation:"WY"}
]
}
分享到:
相关推荐
dojo.js 1.4.2dojo.js 1.4.2dojo.js 1.4.2dojo.js 1.4.2dojo.js 1.4.2dojo.js 1.4.2dojo.js 1.4.2
dojo.js.uncompressed.js 1.4.2dojo.js.uncompressed.js 1.4.2dojo.js.uncompressed.js 1.4.2
dojo是一个开源的JavaScript库,专为构建富互联网应用程序(RIA)而设计。它提供了一整套功能,包括AJAX、动画、数据存储、DOM操作、事件处理、国际化、主题、工具提示等。在"dojo.zip"这个压缩包中,我们可以找到与...
标题中的“多文件上传 dojo组件 dojox.form.FileUploader”是指使用Dojo JavaScript库中的dojox.form.FileUploader组件来实现网页上的多文件上传功能。Dojo是一个强大的JavaScript框架,它提供了丰富的UI组件和工具...
**DOJO.js 框架详解** DOJO.js 是一个功能强大的JavaScript库,它被誉为“最优秀的js框架”之一,特别是在版本1.9.3中,这个称号得到了充分的体现。DOJO以其全面的特性、模块化的设计以及对各种浏览器的良好支持而...
dojo.xd.js 最新JavaScript框架组件!
《Mastering Dojo》是2008年6月由Pragmatic Bookshelf出版的一本技术书籍,专注于JavaScript库Dojo的深入学习。这本书详细介绍了Dojo工具集,旨在帮助开发者充分利用这个强大的JavaScript框架,提升Web应用开发的...
dojo.js
dojo.js.uncompressed.js 1.92版
【Dojo.GUI_v6.zip for pencil】是一款专为Pencil设计的GUI模板资源包,它扩展了Pencil这款优秀的Web原型设计工具的功能和视觉元素。Pencil是一个免费且开源的应用程序,允许用户创建各种交互式原型,适用于网页、...
Dojo学习笔记-- dojo.event & dojo.event.topic & dojo.event.browser Dojo学习笔记--DateTextbox Dojo学习笔记--Dojo的基础对象和方法 Dojo学习笔记--FisheyeList鱼眼效果 Dojo学习笔记--TabContainer Dojo...
Dojo学习笔记-- dojo.event & dojo.event.topic & dojo.event.browser Dojo学习笔记--DateTextbox Dojo学习笔记--Dojo的基础对象和方法 Dojo学习笔记--FisheyeList鱼眼效果 Dojo学习笔记--TabContainer Dojo...
Dojo学习笔记-- dojo.event & dojo.event.topic & dojo.event.browser Dojo学习笔记--DateTextbox Dojo学习笔记--Dojo的基础对象和方法 Dojo学习笔记--FisheyeList鱼眼效果 Dojo学习笔记--TabContainer Dojo...
在深入学习Dojo之前,了解JavaScript的基础知识,尤其是面向对象编程的概念,是非常重要的,因为这将有助于更好地理解和使用Dojo的高级特性。 首先,让我们从基础开始,探讨Dojo的核心概念——模块和包。Dojo的模块...
domino xapges 其中的dojo.xhrGet 和 dojo.xhrPost例子
Dojo学习笔记-- dojo.event & dojo.event.topic & dojo.event.browser Dojo学习笔记--DateTextbox Dojo学习笔记--Dojo的基础对象和方法 Dojo学习笔记--FisheyeList鱼眼效果 Dojo学习笔记--TabContainer Dojo...
Dojo 是一个功能丰富的 JavaScript 库,它提供了一系列模块化、面向对象的工具,用于构建高性能的 Web 应用程序。在 Dojo 中,模块和包的概念是核心组成部分,它们帮助开发者组织和管理代码,使其更易于维护和重用。...
难得纯净资源,不用下载其他乱起八糟的东西了
dojo.js.核心jsDojo.js核心dojo的javaScript类库Dojo.js核心dojo的javaScript类库Dojo.js核心dojo的javaScript类库Dojo.js核心dojo的javaScript类库
总之,《Dojo: The Definitive Guide》这本书将引导读者深入了解Dojo框架,学习如何利用其强大的功能来构建高效、可维护的Web应用。通过阅读和实践书中的内容,开发者可以提升JavaScript编程技能,并在实际项目中...