Javascript can';不要从对话框中更改标题
我无法更改此对话框中的标题:Javascript can';不要从对话框中更改标题,javascript,dojo,dijit.form,Javascript,Dojo,Dijit.form,我无法更改此对话框中的标题: var myDialog = dijit.byId('myDialog_' + self["index"]); if (!myDialog) { //setting date for the dialog endTime = new Date(); var endDate = endTime.cust
var myDialog = dijit.byId('myDialog_'
+ self["index"]);
if (!myDialog) {
//setting date for the dialog
endTime = new Date();
var endDate = endTime.customFormat("#DD#.#MM#.#YYYY#");
startTime = new Date(endTime.getTime() - (endTime.getHours() * 3600000) - (endTime.getMinutes() * 60000) - (endTime.getSeconds() * 1000) - 518400000); //one week
var startDate = startTime.customFormat("#DD#.#MM#.#YYYY#");
myDialog = new dijit.Dialog({
id : 'myDialog_' + self["index"],
title : 'Chart ' + _params.chartTitle
+ " vom " + startDate + " bis "
+ endDate,
style : 'width:820px;height:500px;'
});
//destroy objects after closing the dialog
myDialog.connect(myDialog, "hide", function (e) {
myDialog.destroy();
//graph.destroy();
dojo.destroy(trafficLight);
dijit.byId("selectVK_" + self["index"]).destroy();
dijit.byId("selectTime_" + self["index"]).destroy();
});
}
我试过这个:
dojo.byId('myDialog_' + self["index"]).title ="test";
dojo.byId("myDialog_" + self["index"]).set( 'title', "huhu");
myDialog.set( 'title', "huhu");
dojo.byId(myDialog).set( 'title', "huhu");
但是什么都没发生。。。我试过这个:
dojo.byId('myDialog_' + self["index"]).title ="test";
dojo.byId("myDialog_" + self["index"]).set( 'title', "huhu");
myDialog.set( 'title', "huhu");
dojo.byId(myDialog).set( 'title', "huhu");
我总是得到错误,set()不是一个函数。。。
有什么建议吗?您必须获得dijit才能设置标题
dijit.byId("myDlg").set("title", "new title");
或
fiddle:您也可以使用对话框实例:
myDialog.set(“标题”、“新标题”)你能提供一把小提琴吗?