求救啊,关于ext 显示的一个问题,大家帮帮忙啊。
用的是 java ext就像这样
没点击 右边的日历 就会出现一个值,就是这样的
怎么做啊,下面是我的代码
this.queryFormPanelItems = [
{ items:[
{ columnWidth:.57, labelWidth:70, items : [
{ type:"date",id:"ordDateStart", fieldLabel:"订货日期", name:"ordDateStart", textWidth:95},
{ type:"date", fieldLabel:"要求纳期", name:"ordDeliDateStart", textWidth:95}
]},
{ columnWidth:.43, labelWidth:5, items : [
{ type:"date",id:"ordDateEnd", fieldLabel:"至", labelSeparator:"", name:"ordDateEnd", textWidth:97},
{ type:"date", fieldLabel:"至", labelSeparator:"", name:"ordDeliDateEnd", textWidth:97}
]}
]}
给你这段代码 你贴上去试试
... 10:59:15
function cD(){
var dt=new Date();
var ordDateEnd1=dt.getYear()+"-"+(dt.getMonth()+1)+"-"+dt.getDate()+" "+dt.getHours()+":"+dt.getMinutes()+":"+dt.getSeconds()+"";
dt.setMonth(dt.getMonth()-1);
var ordDateStart1=dt.getYear()+"-"+(dt.getMonth()+1)+"-"+dt.getDate()+" "+dt.getHours()+":"+dt.getMinutes()+":"+dt.getSeconds()+"";
//document.getElementById('ordDateStart').innerHTML="当前时间:"+ordDateEnd+"<br /><br />"+"减去1个月的时间:"+ordDateStart;
alert(ordDateStart1);
alert(ordDateEnd1);
}
cD();
这是我写的这段代码
就是 怎么能把我写出来的这个值 赋值给文本框
就日期那个文本框
--------------------编程问答-------------------- ?????????没人帮忙回答回答 --------------------编程问答-------------------- 给ext的时间文本框赋值(datetimefield)
Ext.getCmp("文本框的id").setValue("2011-02-02"); --------------------编程问答--------------------
这个不行的
ext.get('..')为空或不是对象
--------------------编程问答-------------------- 有谁会啊,帮帮忙啊。 --------------------编程问答-------------------- var sdate = new Ext.form.FormPanel({
xtype: "form",
title: "",
items: [{
xtype: "datefield",
fieldLabel: "开始时间",
readOnly: true,
name: "wdate"
}]
});
下面直接加上 sdate就可以 --------------------编程问答--------------------
按上面的写法,在datefield中有个属性是可以显示默认值的,在上面的items里加上就可以了。你要想显示的是时间可以是系统时间,也可以是你默认的时间。并且最好加上formate,格式化下时间 --------------------编程问答--------------------
是哪个属性?
就是显示系统时间
--------------------编程问答-------------------- 你什么版本的? 3? 4?
Ext.getCmp("文本框的id").setValue("2011-02-02");
我表示这种方法可以 getCmp...不是get --------------------编程问答--------------------
我这里默认就是当前时间,不好用?
补充:Java , Java EE