天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

ExtJs 3.1 XmlTreeLoader Example Error

前言
  關鍵字:ExtJs 3.1 XmlTreeLoader Example Error,XmlTreeLoader 錯誤,TreePanel Error

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

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

正文

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

   2.  注意標紅新增代碼",requestMethod: 'GET'"!!
復制代碼 代碼如下:
/*!
* Ext JS Library 3.1.0
* Copyright(c) 2006-2009 Ext JS, LLC
* [email protected]
* 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 = '<i>Select a book to see more information...</i>';

var tpl = new Ext.Template(
'<h2 class="title">{title}</h2>',
'<p><b>Published</b>: {published}</p>',
'<p><b>Synopsis</b>: {innerText}</p>',
'<p><a href="{url}" target="_blank">Purchase from Amazon</a></p>'
);
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
}]
});
});

結束語

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

JavaScript技術ExtJs 3.1 XmlTreeLoader Example Error,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 无码射肉在线播放视频 | 健身房被教练啪到腿软H | 恋夜秀场支持安卓版全部视频国产 | 欧美wwwvideos在线观看 | 久久久久久久99精品免费观看 | 久草色香蕉视频在线 | 116美女写真午夜电影z | 大陆极品少妇内射AAAAAA | 开心色99xxxx开心色 | 中文无码在线观 | 女仆翻身大作战 | 幺妹视频福利视频 | 国产亚洲国际精品福利 | av影音先锋影院男人站 | 夜色88V精品国产亚洲AV | 女的把腿张开男的往里面插 | 午夜DJ国产精华日本无码 | 国产精品视频大全 | 日韩精品 电影一区 亚洲高清 | 野花日本免费完整版高清版动漫 | 99热在线免费播放 | 色姊姊真舒服 | 黑人巨大交牲老太 | 精品无码一区二区三区中文字幕 | 久久久久国产精品美女毛片 | 日韩精品免费在线观看 | 亚洲视频在线免费观看 | 女子叉开腿让男子桶免费软件 | 6 10young俄罗斯| 国产精选视频在线观看 | 欧美色偷偷亚洲天堂bt | 东京热无码中文字幕av专区 | 添加一点爱与你电视剧免费观看 | 日日噜噜噜夜夜爽爽狠狠 | 色综合 亚洲 自拍 欧洲 | 国产亚洲精品久久久999无毒 | 中文字幕在线观看亚洲日韩 | 蜜芽资源高清在线观看 | 小黄文纯肉短篇 | 日本人作爰啪啪全过程 | 亚洲欧美国产旡码专区 |