以下是搜索的三个tbar,startDate,endDate,tb(搜索按钮),
var startDate = new Ext.form.DateField({
以下是搜索的三个tbar,startDate,endDate,tb(搜索按钮),
var startDate = new Ext.form.DateField({
id : 'startDate',
readOnly : true,
format : 'Y-m-d',
allowBlank : true
});
var endDate = new Ext.form.DateField({
id : 'endDate',
readOnly : true,
format : 'Y-m-d',
allowBlank : true
});
var tb = new Ext.Toolbar({
items : [{
text : '提交查询',
handler : function() {
ds.load({
params : {
start : 0,
limit : 20,
startDate : Ext.get('startDate').dom.value,
endDate : Ext.get('endDate').dom.value
}
})
}
}]
});
将下面这句放在gridPanel中
tbar : [startDate, " 至 ", endDate, tb],这样就可以了搜索了
本文介绍如何使用ExtJS配置包含开始日期、结束日期及搜索按钮的工具栏(tbar)。通过具体代码示例展示了如何设置只读日期选择器,并在点击搜索按钮时触发加载数据的动作,参数包括开始和结束日期。
174

被折叠的 条评论
为什么被折叠?



