基于配置的ext UI RIA 解决方案 http://slon3dmax.s155.eatj.com/

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>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值