3C科技 娛樂遊戲 美食旅遊 時尚美妝 親子育兒 生活休閒 金融理財 健康運動 寰宇綜合

Zi 字媒體

2017-07-25T20:27:27+00:00
加入好友
李炎恢_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提供 原文連結

寫了 5860316篇文章,獲得 23313次喜歡
精彩推薦