茄子在线看片免费人成视频,午夜福利精品a在线观看,国产高清自产拍在线观看,久久综合久久狠狠综合

    <s id="ddbnn"></s>
  • <sub id="ddbnn"><ol id="ddbnn"></ol></sub>

  • <legend id="ddbnn"></legend><s id="ddbnn"></s>

    Extjs實(shí)現(xiàn)下拉菜單效果
    來(lái)源:易賢網(wǎng) 閱讀:1796 次 日期:2016-07-12 14:32:10
    溫馨提示:易賢網(wǎng)小編為您整理了“Extjs實(shí)現(xiàn)下拉菜單效果”,方便廣大網(wǎng)友查閱!

    本文實(shí)例為大家分享了Extjs實(shí)現(xiàn)下拉樹(shù)效果,供大家參考,具體內(nèi)容如下

    <!DOCTYPE html>

    <html>

    <head>

    <meta charset="UTF-8">

    <title>text8</title>

      <link rel="stylesheet" type="text/css" href="../../../ext-4.2.1/resources/css/ext-all.css" >

      <script type="text/javascript" src="../../../ext-4.2.1/bootstrap.js"></script>

    </head>

    <body>

      <script>

           Ext.define('TreeComboBox',{ 

              extend : 'Ext.form.field.ComboBox', 

              store : {

                fields:[],

                data:[[]]

              }, 

              width:300,

              editable : false, 

              allowBlank:false, 

              multiSelect : true,

              listConfig : {

                resizable:false,

                minWidth:150,

                maxWidth:250,

              }, 

              _idValue : null, 

              _txtValue : null, 

              callback : Ext.emptyFn, 

              treeObj : null, 

              initComponent : function(){ 

                  this.treeObj=new Ext.tree.Panel({ 

                    border : false, 

                    autoScroll : true, 

                    rootVisible: false, 

                    renderTo:this.treeRenderId, 

                    root: {

                      text: 'root',draggable: false,expanded: true, 

                        children:[

                          {

                          text:'一級(jí)節(jié)點(diǎn)',expanded: true, checked:false ,

                            children:[

                              { text:'二級(jí)節(jié)點(diǎn)1',leaf:true,checked:false},

                              { text:'二級(jí)節(jié)點(diǎn)2',leaf:true,checked:false}

                              ]

                            } , 

                            {

                          text:'一級(jí)節(jié)點(diǎn)',expanded: true, checked:false ,

                            children:[

                              { text:'二級(jí)節(jié)點(diǎn)1',leaf:true,checked:false},

                              { text:'二級(jí)節(jié)點(diǎn)2',leaf:true,checked:false}

                              ]

                            }

                       ]

                     } ,

                   listeners:{

                     checkchange:function(node,state){

                       if(node.hasChildNodes()){

                         for(var i=0;i<node.childNodes.length;i++){

                           node.childNodes[i].set('checked',state);

                           }

                         }

                       }

                     }

                  });    

                  this.treeRenderId = Ext.id(); 

                  this.tpl = "<tpl><div id='"+this.treeRenderId+"'></div></tpl>";    

                  this.callParent(arguments); 

                  this.on({ 

                      'expand' : function(){ 

                        if(!this.treeObj.rendered&&this.treeObj&&!this.readOnly){ 

                            Ext.defer(function(){ 

                                this.treeObj.render(this.treeRenderId); 

                            },100,this); 

                        } 

                    } 

                }); 

                  this.treeObj.on('itemclick',function(view,rec){ 

                    /* var roonodes = this.treeObj.getRootNode().childNodes;  //獲取主節(jié)點(diǎn)

                     var childnodes = node.childNodes; //獲取zi節(jié)點(diǎn)

                     if (roonodes.getView().getSelectionCount()==1) {

                      for(var i=0;i<childnodes.length;i++){

                        this.setValue(this._txtValue = rec.get('text'));  

                      }

                     }*/

                      if(rec){ 

                        //node.getUI().checkbox.indeterminate = true; //半選中狀態(tài) 

                        this.setValue(this._txtValue = rec.get('text'));         

                        //this.collapse();//關(guān)閉tree 

                      } 

                  },this); 

              }, 

          }); 

        //實(shí)例化下拉樹(shù) 

        var xltree1=new TreeComboBox({ 

          fieldLabel : '下拉樹(shù)1', 

          name:'xltree1111', 

          allowBlank:true 

        });  

        var xltree2=new TreeComboBox({ 

          fieldLabel : '下拉樹(shù)2', 

          name:'xltree2222', 

          allowBlank:true 

        }); 

        Ext.create('Ext.form.Panel', { 

          renderTo: Ext.getBody(), 

          width: 500, 

          bodyPadding: 10, 

          title: 'TreeComboBox', 

          items: [xltree1, xltree2] 

        }); 

      </script>

    </body>

    </html>

    問(wèn)題:當(dāng)選中復(fù)選框時(shí)候,如何使全部選中的條目添加顯示到combobox中?

    效果:

    名單

    下面是另一個(gè):

    <!DOCTYPE html>

    <html>

    <head>

    <meta charset="UTF-8">

    <title>tabpanel</title>

      <link rel="stylesheet" type="text/css" href="../../../ext-4.2.1/resources/css/ext-all.css" >

      <script type="text/javascript" src="../../../ext-4.2.1/bootstrap.js"></script>

    </head>

    <body>

      <script>

            Ext.onReady(function(){

                Ext.create('Ext.window.Window',{

                    id: 'docaddId',

                    title: 'Preferences',

                    buttonAlign: 'center',

                    width:500,

                    layout:'fit',

                    //height:400,

                    resizable:false,

                    items:

                        Ext.create('Ext.tab.Panel', {

                          //renderTo: Ext.getBody(),

                          items: [{

                            title: 'A',

                            items:[

                            //Process and associated workstation下拉選框

                            {

                      xtype:'container',

                      fieldLabel:'Workstation',

                      items:[{

                          xtype:"combobox",

                          name : 'Process and associated workstation',  

                      fieldLabel : 'Workstation',  

                      id:'aaa',

                      layout:'fit',

                      width:480,

                      editable : false,  

                      allowBlank : false,  

                      multiSelect : true,  

                      store : {  

                      fields : ['workstationId', 'workstationName'],  

                      data : [  

                        {'workstationId':'0',workstationName:'workstation01'},  

                        {'workstationId':'1',workstationName:'workstation02'},  

                        {'workstationId':'2',workstationName:'workstation03'},  

                        {'workstationId':'3',workstationName:'workstation04'}  

                      ]  

                      },  

                      listConfig : {  

                      itemTpl : Ext.create('Ext.XTemplate','<input type=checkbox>{[values.workstationName]}'),  

                      onItemSelect : function(record) {  

                        var node = this.getNode(record);  

                        if (node) {  

                        Ext.fly(node).addCls(this.selectedItemCls);  

                        var checkboxs = node.getElementsByTagName("input");  

                        if (checkboxs != null)  

                          var checkbox = checkboxs[0];  

                        checkbox.checked = true;  

                        }  

                      },  

                      listeners : {  

                        itemclick : function(view, record, item, index, e, eOpts) {  

                        var isSelected = view.isSelected(item);  

                        var checkboxs = item.getElementsByTagName("input");  

                        if (checkboxs != null) {  

                          var checkbox = checkboxs[0];  

                          if (!isSelected) {  

                          checkbox.checked = true;  

                          } else {  

                          checkbox.checked = false;  

                          }  

                        }  

                        }  

                      }  

                      },  

                      queryMode : 'remote',  

                      displayField : 'workstationName',  

                      valueField : 'workstationIda',  

                      }

                      ]

                            }]

                          }, {

                            title: 'B'

                          }, {

                            title: 'C'          

                          }, {

                            title: 'D'          

                          }]

                        })        

                }).show();

            });

      </script>

    </body>

    </html>

    效果:

    名單

    以上就是本文的全部?jī)?nèi)容,希望對(duì)大家學(xué)習(xí)javascript有所幫助。

    更多信息請(qǐng)查看網(wǎng)絡(luò)編程
    易賢網(wǎng)手機(jī)網(wǎng)站地址:Extjs實(shí)現(xiàn)下拉菜單效果
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

    2026上岸·考公考編培訓(xùn)報(bào)班

    • 報(bào)班類型
    • 姓名
    • 手機(jī)號(hào)
    • 驗(yàn)證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡(jiǎn)要咨詢 | 簡(jiǎn)要咨詢須知 | 新媒體/短視頻平臺(tái) | 手機(jī)站點(diǎn) | 投訴建議
    工業(yè)和信息化部備案號(hào):滇ICP備2023014141號(hào)-1 云南省教育廳備案號(hào):云教ICP備0901021 滇公網(wǎng)安備53010202001879號(hào) 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號(hào)
    云南網(wǎng)警備案專用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號(hào):hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報(bào)警專用圖標(biāo)