ExtJs學(xué)習(xí)資料9-Ext.Window表單信息修改操作實(shí)例_第1頁(yè)
ExtJs學(xué)習(xí)資料9-Ext.Window表單信息修改操作實(shí)例_第2頁(yè)
ExtJs學(xué)習(xí)資料9-Ext.Window表單信息修改操作實(shí)例_第3頁(yè)
ExtJs學(xué)習(xí)資料9-Ext.Window表單信息修改操作實(shí)例_第4頁(yè)
ExtJs學(xué)習(xí)資料9-Ext.Window表單信息修改操作實(shí)例_第5頁(yè)
已閱讀5頁(yè),還剩1頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、extjs學(xué)習(xí)資料ext.window表單信息修改操作實(shí)例2021年10月29日星期五1、引入extjs框架文件(存入global.js文件中)document.write("<link rel="stylesheet" type="text/css" href="./extjs/resources/css/ext-all.css"/> ");document.write("<script type="text/javascript" src="./extj

2、s/adapter/ext/ext-base.js"></script>");document.write("<script type="text/javascript" src="./extjs/ext-all.js"></script>");document.write("<script type="text/javascript" src="./extjs/ext-lang-zh_cn.js"></s

3、cript>");2、頁(yè)面樣式表<style type="text/css">html,bodybackground-color:#c7d6e9</style>3、引入global.js文件<script type="text/javascript" src="global.js"></script>4、效果圖=5、js源代碼<script type="text/javascript">var _window=null;function s

4、howwin()ext.get("showbtn").dom.disabled=true;_window.show();ext.onready(function()/-開始->var job=ext.data.record.create(name:"position");_window=new ext.window(title:"添加成員信息",plain:true,width:500,autoheight:true,bodystyle:"padding:5px",defaulttype:"text

5、field",defaults:anchor:"100%",layout:"form",labelwidth:60,labelalign:"right",closeaction:"hide",closable:false,/=items:xtype:"panel", layout:"column", basecls:"x-plain", style:"padding:1px",items:/兩列中左列columnwidth:0

6、.5, defaulttype:"textfield", defaults:width:150,layout:"form", bodystyle:"padding:5px", labelalign:"right",labelwidth:55, basecls:"x-plain",items:emptytext:"請(qǐng)輸入姓名", fieldlabel:"姓名",fieldlabel:"年齡", readonly:true, width:4

7、0, value:28,xtype:"datefield", format:"y-m-d", value:"1979-06-19",/value:(new date(),width:100, readonly:true, emptytext:"請(qǐng)選擇出生日期",fieldlabel:"出生日期",listeners:"blur":function(_df)var _age=_window.findbytype("textfield")1;_age.setv

8、alue(new date().getfullyear()-_df.getvalue().getfullyear()+1);,fieldlabel:"聯(lián)系電話", emptytext:"請(qǐng)輸入聯(lián)系電話",fieldlabel:"手機(jī)號(hào)碼", emptytext:"請(qǐng)輸入手機(jī)號(hào)碼",fieldlabel:"電子郵件", emptytext:"請(qǐng)輸入電子郵件",xtype:"combo", fieldlabel:"性別", emptytex

9、t:"請(qǐng)選擇性別",width:100, mode:"local", /remotedisplayfield:"sex", readonly:true, triggeraction:"all", /queryvalue:"男", store:new ext.data.simplestore(fields:"id","sex",data:1,"男",2,"女"),/兩列中右列l(wèi)ayout:"form"

10、;, columnwidth:0.5, labelwidth:55, basecls:"x-plain",bodystyle:"padding:5px",items:xtype:"textfield", width:160, height:180, inputtype:"image", fieldlabel:"個(gè)人照片",fieldlabel:"身份證號(hào)", emptytext:"請(qǐng)輸入身份證號(hào)", width:360,fieldlabel:"具

11、體地址", emptytext:"請(qǐng)輸入具體地址", width:360,xtype:"panel", layout:"column", basecls:"x-plain", defaults:basecls:"x-plain",bodystyle:"padding:2px",items:columnwidth:0.4, layout:"form", labelwidth:58,items:xtype:"combo", emp

12、tytext:"請(qǐng)選擇.", displayfield:"position",triggeraction:"all", listeners:"select":function(_combo,_record,_index)/alert(_record.get("position");_combo"selectitem"=_record;,mode:"local", readonly:true, fieldlabel:"職位",/width

13、:100,anchor:"100%",store:new ext.data.simplestore(fields:"position",data:"程序員","經(jīng)理","主管"),columnwidth:0.2,bodystyle:"padding:0 0 0 5px",items:xtype:"button",text:"添加職位",handler:function()var _win=this.ownerct.ownerct.own

14、erct;var _job=_win.findbytype("combo")1;ext.mmpt("請(qǐng)輸入職位的名稱","職位名稱:",function(btnvalue,txtvalue)if(btnvalue="ok")/alert(_job.getvalue();/var _store=this.store;var _store=this.getstore();_store.insert(0,new job(position:txtvalue);this.setvalue(txtvalue);th

15、is"selectitem"=this.store.getat(0);,_job);,columnwidth:0.2,items:xtype:"button",text:"修改職位",handler:function()var _win=this.ownerct.ownerct.ownerct;var _job=_win.findbytype("combo")1;/alert(_job"selectitem");if(_job"selectitem"!=null)ext.me

16、ssagebmpt("請(qǐng)輸入修改后的職位名稱","職位名稱",function(btnvalue,txtvalue)/alert(btnvalue);if(btnvalue="ok")/alert(txtvalue);/alert(_job"selectitem");this"selectitem".set("position",txtvalue);this.setvalue(txtvalue);,_job,false,_job.getvalue();,colum

17、nwidth:0.2,items:xtype:"button",text:"刪除職位",handler:function(btnvalue)var _win=this.ownerct.ownerct.ownerct;var _job=_win.findbytype("combo")1;if(_job"selectitem"!=null)ext.msg.confirm("系統(tǒng)提示","你確認(rèn)刪除當(dāng)前的職位嗎?",function(btnvalue)if(btnvalue=&qu

18、ot;yes")trythis.store.remove(this"selectitem");catch(e)if(this.store.getcount()!=0)this.setvalue(this.store.getat(0).get("position");this"selectitem"=this.store.getat(0);elsethis.setvalue("");this"selectitem"=null;,_job);,lock:false,listeners:"show":function(_window)/alert(_window.rendered);/alert(_window"lock");if(!_window"lock")/alert(_window"lock");_window.findbytype("textfield")7.getel().dom.src="admin.gif"var _job=_window.findbytype("combo")1;/var

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論