怎么做:extjs语法中的document.getElementById()

Vic*_*tor 13 extjs

在jsp中,如果有隐藏变量,我们在js中执行此操作:

document.getElementById('hiddenVarId').setValue = 'xxx';
Run Code Online (Sandbox Code Playgroud)

什么是extjs相当于 document.getElementById().setValue = 'xxx';

Chr*_*isR 18

Ext.get('hiddenVarId').set({value: 'xxx'});
Run Code Online (Sandbox Code Playgroud)

这另一种利用ExtJS方法的可能性set().这样,您可以立即在Ext.Element上设置多个属性,如果您现在或以后都需要这些属性.

http://dev.sencha.com/deploy/dev/docs/?class=Ext.Element


wom*_*ton 7

Ext.get('hiddenVarId').dom.value = 'xxx';
Run Code Online (Sandbox Code Playgroud)

Ext.get返回一个Ext.Elementdom属性中有实际DOM对象的东西.然后,您可以直接分配给该value属性.