日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ext 2.0 Combos 使用指南

發(fā)布時間:2023/12/29 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ext 2.0 Combos 使用指南 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

這是個簡單的例子,只需要簡單的解釋下,按步就班,從簡單到復雜!

例子由兩部分組成:lcombo.html 和 lcombo.js.

lcombo.html

view plain copy to clipboard print ?
  • <!DOCTYPE?HTML?PUBLIC? "-//W3C//DTD?HTML?4.01?Transitional//EN" ???
  • ????"http://www.w3.org/TR/html4/loose.dtd" >??
  • <html>??
  • <head>??
  • ????<meta?http-equiv="Content-Type" ?content= "text/html;?charset=utf-8" >??
  • ????<link?rel="stylesheet" ?type= "text/css" ?href= "../extjs-2.0/resources/css/ext-all.css" >??
  • ????<script?type="text/javascript" ?src= "../extjs-2.0/adapter/ext/ext-base.js" ></script>??
  • ????<script?type="text/javascript" ?src= "../extjs-2.0/ext-all-debug.js" ></script>??
  • ????<script?type="text/javascript" ?src= "lcombo.js" ></script>??
  • ????<!--?A?Localization?Script?File?comes?here?-->??
  • ????<script?type="text/javascript" >??
  • ????????Ext.onReady(LCombo.app.init,?LCombo.app);??
  • ????</script>??
  • ????<title>Linked?Combos?Example</title>??
  • </head>??
  • <body>??
  • </body>??
  • </html>??
  • <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link rel="stylesheet" type="text/css" href="../extjs-2.0/resources/css/ext-all.css"><script type="text/javascript" src="../extjs-2.0/adapter/ext/ext-base.js"></script><script type="text/javascript" src="../extjs-2.0/ext-all-debug.js"></script><script type="text/javascript" src="lcombo.js"></script><!-- A Localization Script File comes here --><script type="text/javascript">Ext.onReady(LCombo.app.init, LCombo.app);</script><title>Linked Combos Example</title> </head> <body> </body> </html>

    這是ext運用的最小html!
    不要忘記改變ext類庫和資源的引用來部署你的ext!

    lcombo.js

    view plain copy to clipboard print ?
  • /** ?
  • ??*?Ext?2.0?Linked?Combos?Tutorial ?
  • ??*?by?Jozef?Sakalos,?aka?Saki ?
  • ??*?extjs.com/learn/Tutorial:Linked_Combos_Tutorial_for_Ext_2 ?
  • ??*/ ??
  • ???
  • //?reference?local?blank?image ??
  • Ext.BLANK_IMAGE_URL?=?'../extjs-2.0/resources/images/default/s.gif' ;??
  • ???
  • Ext.namespace('LCombo' ,? 'LCombo.countries' ,? 'LCombo.cities' );??
  • ???
  • LCombo.countries?=?[??
  • ?????['USA' ,? 'United?States?of?America' ]??
  • ????,['D' ,? 'Germany' ]??
  • ????,['F' ,? 'France' ]??
  • ????,['GB' ,? 'Great?Britain' ]??
  • ];??
  • ???
  • LCombo.cities?=?[??
  • ?????[1,?'USA' ,? 'New?York' ]??
  • ????,[2,?'USA' ,? 'Cleveland' ]??
  • ????,[3,?'USA' ,? 'Austin' ]??
  • ????,[4,?'USA' ,? 'Los?Angeles' ]??
  • ????,[5,?'D' ,? 'Berlin' ]??
  • ????,[6,?'D' ,? 'Bonn' ]??
  • ????,[7,?'F' ,? 'Paris' ]??
  • ????,[8,?'F' ,? 'Nice' ]??
  • ????,[9,?'GB' ,? 'London' ]??
  • ????,[10,?'GB' ,? 'Glasgow' ]??
  • ????,[11,?'GB' ,? 'Liverpool' ]??
  • ];??
  • ???
  • //?create?application ??
  • LCombo.app?=?function ()?{??
  • ????//?do?NOT?access?DOM?from?here;?elements?don't?exist?yet ??
  • ???
  • ????//?private?variables ??
  • ???
  • ????//?private?functions ??
  • ???
  • ????//?public?space ??
  • ????return ?{??
  • ???
  • ????????//?public?methods ??
  • ????????init:?function ()?{??
  • ????????????var ?form?=? new ?Ext.FormPanel({??
  • ?????????????????renderTo:document.body??
  • ????????????????,width:?400??
  • ????????????????,height:?300??
  • ????????????????,style:'margin:16px' ??
  • ????????????????,bodyStyle:'padding:10px' ??
  • ????????????????,title:'Linked?Combos' ??
  • ????????????????,defaults:?{xtype:'combo' }??
  • ????????????????,items:[{??
  • ?????????????????????fieldLabel:'Select?Country' ??
  • ????????????????????,displayField:'country' ??
  • ????????????????????,valueField:'cid' ??
  • ????????????????????,store:?new ?Ext.data.SimpleStore({??
  • ?????????????????????????fields:['cid' ,? 'country' ]??
  • ????????????????????????,data:LCombo.countries??
  • ????????????????????})??
  • ????????????????????,triggerAction:'all' ??
  • ????????????????????,mode:'local' ??
  • ????????????????????,listeners:{select:{fn:function (combo,?value)?{??
  • ????????????????????????var ?comboCity?=?Ext.getCmp( 'combo-city' );??????????
  • ????????????????????????comboCity.setValue('' );??
  • ????????????????????????comboCity.store.filter('cid' ,?combo.getValue());??
  • ????????????????????????}}??
  • ????????????????????}??
  • ???
  • ????????????????},{??
  • ?????????????????????fieldLabel:'Select?City' ??
  • ????????????????????,displayField:'city' ??
  • ????????????????????,valueField:'id' ??
  • ????????????????????,id:'combo-city' ??
  • ????????????????????,store:?new ?Ext.data.SimpleStore({??
  • ?????????????????????????fields:['id' ,? 'cid' ,? 'city' ]??
  • ????????????????????????,data:LCombo.cities??
  • ????????????????????})??
  • ????????????????????,triggerAction:'all' ??
  • ????????????????????,mode:'local' ??
  • ????????????????????,lastQuery:'' ??
  • ????????????????}]??
  • ????????????});??
  • ????????}??
  • ????};??
  • }();?//?end?of?app ??
  • ???
  • //?end?of?file ?
  • 總結

    以上是生活随笔為你收集整理的ext 2.0 Combos 使用指南的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。