search
尋找貓咪~QQ 地點 桃園市桃園區 Taoyuan , Taoyuan

李炎恢_PHP_jQuery EasyUI[024] ~ Combo(自訂下拉清單)組件 – jashliao部落格

李炎恢_PHP_jQuery EasyUI[024] ~ Combo(自訂下拉清單)組件


參考資料: https://github.com/jash-git/jash-WebSI

GITHUB: https://github.com/jash-git/richie_jQuery_EasyUI


My code:

$(function () {

	$('#box').combo({
		//width : 300,
		//height : 50,
		//panelWidth : 300,
		//panelHeight : 300,
		//editable : false,
		//disabled : true,
		//readonly : true,
		//hasDownArrow : false,
		//value : '123',
		//delay : 1000,
		/*
		onShowPanel : function () {
			alert('显示触发');
		},
		onHidePanel : function () {
			alert('隐藏触发');
		},
		
		onChange : function (newValue, oldValue) {
			alert(newValue + '|' + oldValue);
		},
		*/
		required : true,
	});
	
	$('#food').appendTo($('#box').combo('panel'));
	$('#food input').click(function () {
		var v = $(this).val();
		var s = $(this).next('span').text();
		$('#box').combo('setValue', v).combo('setText', s).combo('hidePanel');
	});
	
	//console.log($('#box').combo('textbox'));
	
	$(document).click(function () {
		//$('#box').combo('resize', 'width');
		//$('#box').combo('showPanel');
		//console.log($('#box').combo('isValid'));
		//console.log($('#box').combo('getText'));
		//console.log($('#box').combo('getValue'));
		$('#box').combo('setValues', ['1','2','3']);
		console.log($('#box').combo('getValues'));
	});
	
});











jQuery Easy UI















请选择一个食物
煎饼果子
牛腩米线
水果沙拉
蛋黄派
其他


PDF:


執行結果:



熱門推薦

本文由 jashliaoeuwordpress 提供 原文連結

寵物協尋 相信 終究能找到回家的路
寫了7763篇文章,獲得2次喜歡
留言回覆
回覆
精彩推薦