javascript
html中下拉列表监听事件,ExtJS 下拉框监听事件、日期选择器监听事件、实现动态给items添加删除数据...
本文將為您描述ExtJS 下拉框監聽事件、日期選擇器監聽事件、實現動態給items添加刪除數據,具體實現方法:
1、下拉框
下拉框選擇時,觸發事件的方法:
在 Ext.form.ComboBox 組件中新增 listeners 監聽事件
基本寫法為: listeners{'事件',function(){處理方法}}
listeners:{
select:{
fn:function(combo,record,index) {
}
}
}
2、日期選擇器
選擇日期時,值發生變化,并且在失去焦點之前觸發此事件,也就是說如果此日期組件的值發生變化,而焦點并沒有失去,這個事件也就不會觸發。解決方法:
menuListeners : {
select: function(m, d){
this.setValue(d);
alert((d - stringToDate(Ext.getCmp('endDate').value)) / (1000 * 60 * 60 * 24));
},
show : function(){ // retain focus styling
this.onFocus();
},
hide : function(){
this.focus.defer(10, this);
var ml = this.menuListeners;
this.menu.un("select", ml.select, this);
this.menu.un("show", ml.show, this);
this.menu.un("hide", ml.hide, this);
}
3、Items 動態增刪
當根據不同的查詢方式,需要不同的條件查詢方式時,需要在選擇查詢方式下拉框時,觸發監聽事件,動態更新 items 中的數據
ExtJS 下拉框監聽事件、日期選擇器監聽事件、實現動態給items添加刪除數據就為您介紹到這里,感謝您關注懶咪學編程c.lanmit.com.
本文地址:https://c.lanmit.com/Webqianduan/htmlyucss/28319.html
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的html中下拉列表监听事件,ExtJS 下拉框监听事件、日期选择器监听事件、实现动态给items添加删除数据...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: html不换行溢出省略号代替,css控制
- 下一篇: html选中radio隐藏div,rad