Extjs DatePicker 返还值的问题.

我是比较初级的extjs user, 我想在一个grid里面, 点击一个button, 就会弹出一个窗口, 里面有两个Ext.DatePicker: Start Date 和 End Date. 然后有一个OK, 和一个Cancel button. 请问对这种标准的模块, 有没有现成的例子参考? 我怎么样从弹出窗口里返还选中的Start Date 和 End Date 到我的grid 里面? 多谢指点.

你在你说的grid里的button按钮 点击的时候 把我这个window show一下

我那个window点击ok 的时候 开始时间和结束时间都获得了 具体你想返回grid里面的哪里 我不是很清楚
如果你要返回grid的tbar上 用setValue
如果你是更新某一行的数据的开始时间 和结束时间 则先取得要改的行的record 然后调用record的 set( String name, Object value ) : void
将指定名称的字段设置为指定的值 这个方法 set进去就行

var  startDate  = new Ext.DatePicker({
  fieldLabel:"开始时间"
})
var  endDate  = new Ext.DatePicker({
  fieldLabel:"结束时间"

})
var form = new Ext.form.FormPanel({
    frame: true,
    layout:"column",
    labelAlign: "left",
    labelWidth:60,
    items: [
        {
          layout:"form",
          columnWidth: .45,
          items:[startDate]
        },{
          layout:"form",
          columnWidth: .45,
          items:[endDate]
        }]
});

var win = new Ext.Window({
    width: 600,
    title: 'form',
    height: 300,
    closeAction: 'hide',
    layout:"fit",
    items: [form],
    buttonAlign: "center",
    buttons: [{
        text:'ok',handler:function(){
           alert("开始时间:"+startDate.getValue().format("Y-m-d")+"\n"+
                 "结束时间:"+endDate.getValue().format("Y-m-d"));
        }
    }]
});
win.show();

效果图如下: 值都取到了 然后传给你的grid 就看你的业务了
[img]http://dl.iteye.com/upload/attachment/289400/ca8ae554-5da2-3f9d-89ff-3adb27b4c6ba.jpg[/img]