Ext各种赋值的方法

var form = Ext.getCmp('teacherInInfoForm').getForm();
1.form清空
form.reset();
2.赋值
form.setValues(recs[0].data);
3.选中第一行
grid.getSelectionModel().selectFirstRow();
4.取得选中行的值
grid.getSelectionModel().getSelected()
5.判断是否选中
grid.getSelectionModel().hasSelection()
6.form某个赋初值
this.searchPanel.form.findField(id).startValue.setValue(value);

GridPanel.getSelectionModel().selectRow(0);
7.获取列名
grid.getColumnModel().getColumnId(index2);
8.给panel中的form赋值
patientInfoFormPanel.getForm().loadRecord(Ext.getCmp('patientInfoQueryPanel').grid.getSelectionModel().getSelected());
9.给单选和复选框增加事件
a.radio---check
b.checkbox ---check
b.radiogroup--change
{
										xtype: 'radiogroup',
										name: 'time_type',
										hidden: this.flag,
										width: 120,
										items: [
											{name: 'type_v', boxLabel: '每周', inputValue: 1,checked: true},
											{name: 'type_v', boxLabel: '每天', inputValue: 0}
										],
										listeners : {
											change:function(cb, checked ){
									            	alert(checked);
											}
}

10.树形取得节点值
var treePanel = Ext.getCmp('bigitemTree').treePanel.getSelectionModel().getSelectedNode();;
	var userObject = treePanel.node.attributes.bigItemType;

你可能感兴趣的:(ext)