ext笔记
//获取json格式数据以json格式显示出来
Ext.util.JSON.encode(_store.getAt(0).data);
//获取age的数据类型
typeof(_store.getAt(0).get("age"))
var _xml =XML.getInstance("table");
var _root = _xml.getRoot();
var _row =root.pushNewNode("row");
_row.pushNeWNode("name","222");
_row.pushNewNode("age","ddd");
Write.write(_xml);
/////////////////////////////////
Ext.data.Record.create(["name","age","sex"]);
//grid行
selModel:new Ext.grid.RowSelectionModel({
singleSelect:true,
listeners:{
"rowselect":function(_sm,_index,_rowRecord)
{
//_sm本身,_index索引,_rowRecord记录
}
}
})
//form
Ext.getCmp("view_form").getForm.loadRecord(_r//记录Record);
_rs =Ext.getCmpp("view_grid").getSelectionModel().getSelected();//等于一个Record
var _values=this.ownerCt.getForm().getValues();//得到form的所有值
_rs.set("name",_values["name"])
store:new Ext.data.JsonStore({
autoLoad:true,//制定store可以自动装载
})
//高级
PersonViewFormPanel = Ext.extend(Ext.form.FormPanel,{
constructor:function(){
PersonViewFormPanel.superclass.constructor.call(this,
renderTo:Ext.getBody(),
...............
)
}
})