怎么样使用extjs来获得指定属性的节点,
ExtJs获取文本框中值的几种方式
1、Html文本框
如:<input type="text" name="test" id="test" >
获取值的方式为:
var tValue = Ext.getDom('test').value;
或者
var tValue = document.getElementById('test').value
2、ExtJs的组件
如:{
id:'test',
xtype:'textfield',
fieldLabel:' 测试',
name:'test',
width:370
}
获取值的方式为:
var tValue = Ext.getCmp('test').getValue()
3、给input增加keyup事件
<input name="staffno" id="staff""/>
var map = new Ext.KeyMap("staff", [
{ key: [10,13],
fn: function(){ alert("Return was pressed");}
}, { key: "abc",
fn: function(){ alert('a, b or c was pressed'); }
}, {
key: "\t",
ctrl:true,
shift:true,
fn: function(){ alert('Control + shift + tab was pressed.'); }
}
]);
});
ExtJs获取文本框中值的几种方式
1、Html文本框
如:<input type="text" name="test" id="test" >
获取值的方式为:
var tValue = Ext.getDom('test').value;
或者
var tValue = document.getElementById('test').value
2、ExtJs的组件
如:{
id:'test',
xtype:'textfield',
fieldLabel:' 测试',
name:'test',
width:370
}
获取值的方式为:
var tValue = Ext.getCmp('test').getValue()
3、给input增加keyup事件
<input name="staffno" id="staff""/>
var map = new Ext.KeyMap("staff", [
{ key: [10,13],
fn: function(){ alert("Return was pressed");}
}, { key: "abc",
fn: function(){ alert('a, b or c was pressed'); }
}, {
key: "\t",
ctrl:true,
shift:true,
fn: function(){ alert('Control + shift + tab was pressed.'); }
}
]);
});