• <fieldset id="8imwq"><menu id="8imwq"></menu></fieldset>
  • <bdo id="8imwq"><input id="8imwq"></input></bdo>
    最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
    問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
    當(dāng)前位置: 首頁 - 科技 - 知識百科 - 正文

    ExtJs3.1XmlTreeLoaderExampleError_extjs

    來源:懂視網(wǎng) 責(zé)編:小采 時間:2020-11-27 20:47:13
    文檔

    ExtJs3.1XmlTreeLoaderExampleError_extjs

    ExtJs3.1XmlTreeLoaderExampleError_extjs:前言 關(guān)鍵字:ExtJs 3.1 XmlTreeLoader Example Error,XmlTreeLoader 錯誤,TreePanel Error ExtJs 3.1的XmlTreeLoader例子折騰了我近一個下午加晚上,官方的例子沒有問題,可以加載xml的數(shù)據(jù),本地IIS死活不行,也不報錯,直接查看官方的代碼也是一模
    推薦度:
    導(dǎo)讀ExtJs3.1XmlTreeLoaderExampleError_extjs:前言 關(guān)鍵字:ExtJs 3.1 XmlTreeLoader Example Error,XmlTreeLoader 錯誤,TreePanel Error ExtJs 3.1的XmlTreeLoader例子折騰了我近一個下午加晚上,官方的例子沒有問題,可以加載xml的數(shù)據(jù),本地IIS死活不行,也不報錯,直接查看官方的代碼也是一模

    前言
      關(guān)鍵字:ExtJs 3.1 XmlTreeLoader Example Error,XmlTreeLoader 錯誤,TreePanel Error

      ExtJs 3.1的XmlTreeLoader例子折騰了我近一個下午加晚上,官方的例子沒有問題,可以加載xml的數(shù)據(jù),本地IIS死活不行,也不報錯,直接查看官方的代碼也是一模一樣的,今早意外給讓我搜到了,不是在官方,而是在貌似一個韓國的博客里面找到的,致敬一下,本文且做其簡單中文"譯"本。

    原文
      http://javarush.com/entry/ExtJS-XmlTreeLoader-Error

    正文

       1.  代碼位置:Ext3.1\examples\tree\xml-tree-loader.js

       2.  注意標(biāo)紅新增代碼",requestMethod: 'GET'"!!
    代碼如下:
    /*!
    * Ext JS Library 3.1.0
    * Copyright(c) 2006-2009 Ext JS, LLC
    * licensing@extjs.com
    * http://www.extjs.com/license
    */

    //
    // Extend the XmlTreeLoader to set some custom TreeNode attributes specific to our application:
    //
    Ext.app.BookLoader = Ext.extend(Ext.ux.tree.XmlTreeLoader, {
    processAttributes : function(attr){
    if(attr.first){ // is it an author node?

    // Set the node text that will show in the tree since our raw data does not include a text attribute:
    attr.text = attr.first + ' ' + attr.last;

    // Author icon, using the gender flag to choose a specific icon:
    attr.iconCls = 'author-' + attr.gender;

    // Override these values for our folder nodes because we are loading all data at once. If we were
    // loading each node asynchronously (the default) we would not want to do this:
    attr.loaded = true;
    attr.expanded = true;
    }
    else if(attr.title){ // is it a book node?

    // Set the node text that will show in the tree since our raw data does not include a text attribute:
    attr.text = attr.title + ' (' + attr.published + ')';

    // Book icon:
    attr.iconCls = 'book';

    // Tell the tree this is a leaf node. This could also be passed as an attribute in the original XML,
    // but this example demonstrates that you can control this even when you cannot dictate the format of
    // the incoming source XML:
    attr.leaf = true;
    }
    }
    });

    Ext.onReady(function(){

    var detailsText = 'Select a book to see more information...';

    var tpl = new Ext.Template(
    '

    {title}

    ',
    '

    Published: {published}

    ',
    '

    Synopsis: {innerText}

    ',
    '

    Purchase from Amazon

    '
    );
    tpl.compile();

    new Ext.Panel({
    title: 'Reading List',
    renderTo: 'tree',
    layout: 'border',
    width: 500,
    height: 500,
    items: [{
    xtype: 'treepanel',
    id: 'tree-panel',
    region: 'center',
    margins: '2 2 0 2',
    autoScroll: true,
    rootVisible: false,
    root: new Ext.tree.AsyncTreeNode(),

    // Our custom TreeLoader:
    loader: new Ext.app.BookLoader({
    dataUrl:'xml-tree-data.xml'
    ,requestMethod: 'GET'
    }),

    listeners: {
    'render': function(tp){
    tp.getSelectionModel().on('selectionchange', function(tree, node){
    var el = Ext.getCmp('details-panel').body;
    if(node && node.leaf){
    tpl.overwrite(el, node.attributes);
    }else{
    el.update(detailsText);
    }
    })
    }
    }
    },{
    region: 'south',
    title: 'Book Details',
    id: 'details-panel',
    autoScroll: true,
    collapsible: true,
    split: true,
    margins: '0 2 2 2',
    cmargins: '2 2 2 2',
    height: 220,
    html: detailsText
    }]
    });
    });

    結(jié)束語

      不要放棄和接受一次失敗的搜索,不斷的嘗試改變搜索關(guān)鍵字,哪怕是用詞霸翻成英文也得努力去試試,看不懂不要緊,看懂代碼就行,代碼無國界: )

    聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

    文檔

    ExtJs3.1XmlTreeLoaderExampleError_extjs

    ExtJs3.1XmlTreeLoaderExampleError_extjs:前言 關(guān)鍵字:ExtJs 3.1 XmlTreeLoader Example Error,XmlTreeLoader 錯誤,TreePanel Error ExtJs 3.1的XmlTreeLoader例子折騰了我近一個下午加晚上,官方的例子沒有問題,可以加載xml的數(shù)據(jù),本地IIS死活不行,也不報錯,直接查看官方的代碼也是一模
    推薦度:
    • 熱門焦點

    最新推薦

    猜你喜歡

    熱門推薦

    專題
    Top
    主站蜘蛛池模板: 国模精品一区二区三区| 午夜肉伦伦影院久久精品免费看国产一区二区三区 | 99久久伊人精品综合观看| 无码国内精品久久人妻蜜桃| 国产亚洲色婷婷久久99精品91| 九九精品免视看国产成人| 久久精品aⅴ无码中文字字幕不卡| 香蕉依依精品视频在线播放| 国产精品一区在线观看你懂的| 精品视频一区二区三区免费| 精品不卡一区二区| 中文字幕精品无码久久久久久3D日动漫| 国产精品久久久久乳精品爆| 国产精品一二三区| 国产精品久久久亚洲| 久久99国产乱子伦精品免费| 亚洲精品中文字幕乱码三区 | 亚洲国产精品成人AV无码久久综合影院 | 久久免费99精品国产自在现线| 999国产精品视频| 欧美精品免费观看二区| 国产成人精品福利网站在线| 国产精品第12页| 久久精品国产亚洲AV高清热 | 亚洲综合精品一二三区在线| 亚洲色精品aⅴ一区区三区| 免费精品久久久久久中文字幕| 98香蕉草草视频在线精品看| 97精品人妻一区二区三区香蕉| 99国产精品一区二区| 国产精品久久久久久吹潮| 久久精品国产久精国产思思| 久久99热只有频精品8| 久久精品毛片免费观看| 亚洲处破女AV日韩精品| 无码人妻精品一区二区三区在线 | 无码日韩精品一区二区三区免费| 中文字幕日韩精品无码内射| 中文字幕久久精品无码| 亚洲av无码精品网站| 色欲久久久天天天综合网精品|