【kendo UI】 下拉框 kendoDropDownList

$("#culture").kendoDropDownList({
	                    	select : languageChange,
	                        dataTextField: "text",
	                        dataValueField: "fieldValue",
	                        dataSource: languages,
	                        index: switchIndex('${language==null?"en_US":language}')
//初始化选择值	                    });

function languageChange(te) {
	                       var dataItem = this.dataItem(te.item.index());
		window.location.href="${pageContext.request.contextPath}/login.do?language="+dataItem.fieldValue;
	                    }

var languages = [ { text: "简体中文", fieldValue: "zh_CN" }, 
                  { text: "English", fieldValue: "en_US" },
                  { text: "한국어", fieldValue: "ko_KR" }
              ];

function switchIndex(language){
	if(language!=""){
		for (var i=0;i<languages.length;i++){
			if(language==languages[i].fieldValue){
				return i;
			}
		}
	}
	return 0;
}

 详细请参考:

http://docs.kendoui.com/api/web/dropdownlist

你可能感兴趣的:(list)