Javascript ExtJS更改标签值
我试图使用以下命令显示当前日期和时间:Javascript ExtJS更改标签值,javascript,extjs,sencha-architect,Javascript,Extjs,Sencha Architect,我试图使用以下命令显示当前日期和时间: var currentDate = new Date(); 然后使用下面的代码更新我的标签,但这不起作用: var controller = this; var refs = controller.getReferences(); refs.dateLabelId.text.setValue = currentDate; dateLabelId是我的标签的引用 问题解决 refs.dateLabelId.label.setText(currentD
var currentDate = new Date();
然后使用下面的代码更新我的标签,但这不起作用:
var controller = this;
var refs = controller.getReferences();
refs.dateLabelId.text.setValue = currentDate;
dateLabelId是我的标签的引用
问题解决
refs.dateLabelId.label.setText(currentDate)
问题可通过以下方式解决:
refs.dateLabelId.label.setText(currentDate)
您还可以按如下方式更新字段标签:
参考dateLabelId.setFieldLabel(当前日期) Ext JS 5.1.x@qmatin代替setValue,你有没有尝试使用text.value?是的,没有结果@salooo你能发布你的标签配置代码吗?因为如果您使用的是label,那么您可以使用label.setText('text')方法设置它。我编辑了我的帖子@Saloo