form.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<application>
<viewport layout="anchor">
<items>
<formPanel columnCount="3" title="myformPanel" frame="true"
bodyStyle="padding:10px;" id="myform" labelWidth="60">
<items>
<textField name="name2" fieldLabel="name2" />
<textField name="name2" fieldLabel="name2" />
<textField name="name2" fieldLabel="name2" />
<textField name="name2" fieldLabel="name2" />
<textField name="name2" fieldLabel="name2" singRow="true" />
<textField name="name2" fieldLabel="name2" />
<textField name="name2" fieldLabel="name2" />
<comboBox name="isAdmin" fieldLabel="是否" selectOnFocus="true"
singRow="true" triggerAction="all" displayField="name" valueField="value"
forceSelection="true" mode="local">
<store url="/ExtXmlDemo/res/model?type=com.stone.model.YesOrNo"
storeId="store" autoLoad="true">
<xmlReader>
<config record="enumValue" id="@value" />
<fields>
<field name="name" mapping="@name" />
<field name="value" mapping="@value" />
</fields>
</xmlReader>
</store>
</comboBox>
</items>
</formPanel>
</items>
</viewport>
<resources>
function tt(){
alert(1);
}
</resources>
</application>
grid.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<application>
<viewport id="fds" layout="anchor">
<items>
<gridPanel region="center" title="fdasfas" anchor="100%"
id="ss" height="200" >
<listeners>
<rowClick function="gridOnclick" />
</listeners>
<tbar>
<action text="load " handler="onload"></action>
<action text="delete" handler="deleteData"></action>
</tbar>
<store url="sheldon.xml" storeId="store">
<xmlReader>
<config totalRecords="@total" record="Item" id="ASIN" />
<fields>
<field name="name" mapping="ItemAttributes > Author" />
<field name="Title" mapping="Title" />
<field name="Manufacturer" mapping="Manufacturer" />
<field name="ProductGroup" mapping="ProductGroup" />
</fields>
</xmlReader>
</store>
<columns>
<checkBoxColumn />
<rowNumberer />
<column header="Ticker" width="60" sortable="true" dataIndex="name" />
<column header="Tickerfdsa" width="60" sortable="true" dataIndex="Title" />
<column header="Tickerfdsa" width="60" sortable="true" dataIndex="Manufacturer" />
<column header="Company Name" width="150" sortable="true" dataIndex="ProductGroup" />
</columns>
<bbar>
</bbar>
</gridPanel>
<formPanel region="west" layout="FormLayout" title="myformPanel"
anchor="100%" frame="true" bodyStyle="padding:10px;" id="myform"
labelWidth="60">
<items>
<textField name="name" fieldLabel="name" anchor="95%" />
<textField name="Title" fieldLabel="Title" anchor="95%" />
</items>
<buttons>
<button text="openWindow">
<listeners>
<onClick function="showWindow" />
</listeners>
</button>
</buttons>
</formPanel>
<window title="fdsa" layout="fix" width="500" hide="350" id="mywindow">
<items>
<formPanel
anchor="100%" frame="true" bodyStyle="padding:10px;" id="detailForm"
labelWidth="60">
<items>
<textField name="name" fieldLabel="name" anchor="95%" />
<textField name="Title" fieldLabel="Title" anchor="95%" />
</items>
<buttons>
<button text="fdsa">
<listeners>
</listeners>
</button>
</buttons>
</formPanel>
</items>
</window>
</items>
</viewport>
<resources>
function onload(){
Ext.getCmp("ss").getStore().load();
}
function deleteData(){
alert('delete');
}
function showWindow(){
Ext.getCmp('mywindow').show();
}
function gridOnclick(gd,index,e){
var form = Ext.getCmp('myform');
var data=gd.getSelectionModel().getSelected().data;
form.find("name","name")[0].setValue(data.name);
form.find("name","Title")[0].setValue(data.Title);
}
</resources>
</application>
demo.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<application>
<viewport layout="anchor">
<items>
<gridPanel region="center" title="fdasfas" anchor="100%"
id="ss" height="200" >
<listeners>
<rowClick function="gridOnclick" />
</listeners>
<tbar>
<action text="load " handler="onload"></action>
</tbar>
<store url="../sheldon.xml" storeId="store">
<xmlReader>
<config totalRecords="@total" record="Item" id="ASIN" />
<fields>
<field name="name" mapping="ItemAttributes > Author" />
<field name="Title" mapping="Title" />
<field name="Manufacturer" mapping="Manufacturer" />
<field name="ProductGroup" mapping="ProductGroup" />
</fields>
</xmlReader>
</store>
<columns>
<checkBoxColumn />
<rowNumberer />
<column header="Ticker" width="60" sortable="true" dataIndex="name" />
<column header="Tickerfdsa" width="60" sortable="true" dataIndex="Title" />
<column header="Tickerfdsa" width="60" sortable="true" dataIndex="Manufacturer" />
<column header="Company Name" width="150" sortable="true" dataIndex="ProductGroup" />
</columns>
</gridPanel>
<formPanel title="myformPanel" frame="true"
id="myform" labelWidth="80" columnCount="3" bodyStyle="padding:10px;">
<items>
<textField name="name1" fieldLabel="name1" />
<textField name="name2" fieldLabel="name2" />
<textField name="name3" fieldLabel="name3" />
<textField name="name3" fieldLabel="name3" />
<textField name="name3" fieldLabel="name3" singRow="true" />
<textField name="name3" fieldLabel="name3" />
<textField name="name3" fieldLabel="name3" singRow="true" />
<textField name="name4" fieldLabel="name4" />
<comboBox fieldLabel="是否" displayField="name" valueField="value" singRow="true">
<dataSource record="enumValue"
resUrl="/ExtXmlDemo/res/model?type=com.stone.model.YesOrNo">
<fields>
<field name="name" mapping="@name" />
<field name="value" mapping="@value" />
</fields>
</dataSource>
</comboBox>
</items>
<buttons>
<button text="打开窗口">
<listeners>
<onClick function="showWindow" />
</listeners>
</button>
</buttons>
</formPanel>
<window title="fdsa" layout="fix" width="500" hide="350" id="mywindow">
<items>
<formPanel anchor="100%" frame="true" bodyStyle="padding:10px;"
id="detailForm" columnCount="2" labelWidth="60">
<items>
<textField name="name" fieldLabel="name" anchor="95%" />
<textField name="Title" fieldLabel="Title" anchor="95%" />
</items>
<buttons>
<button text="关闭">
<listeners>
<onClick function="closeWindow" />
</listeners>
</button>
</buttons>
</formPanel>
</items>
</window>
</items>
</viewport>
<resources>
function onload(){
Ext.getCmp("ss").getStore().load();
}
function showWindow(){
Ext.getCmp('mywindow').show();
}
function closeWindow(){
Ext.getCmp('mywindow').hide();
}
function gridOnclick(gd,index,e){
var form = Ext.getCmp('myform');
var data=gd.getSelectionModel().getSelected().data;
form.find("name","name")[0].setValue(data.name);
form.find("name","Title")[0].setValue(data.Title);
}
</resources>
</application>