天天躁日日躁狠狠躁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,轉載需保留來源!

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

主站蜘蛛池模板: 国产成人精品自线拍 | 国产看午夜精品理论片 | 寂寞夜晚在线视频观看 | 亚洲最大在线视频 | AAA级精品无码久久久国片 | 亚洲欧美日韩国产手机在线 | 亚洲精品久久7777777 | 性吧 校园春色 | 欧美成人精品高清在线观看 | 日本久久不射 | 捏奶动态图吃奶动态图q | 超碰视频在线 | 精品AV综合导航 | 男女肉大捧进出全过程免费 | 久久精品人人做人人爽97 | 俄罗斯女人Z0Z0极品 | 成年AV动漫| 国产在线午夜 | 午夜日韩久久影院 | 国产精品xxxav免费视频 | 用快播看黄的网站 | 色妞色视频一区二区三区四区 | 青草久久精品亚洲综合专区 | 精品国产99久久久久久麻豆 | 丝瓜影院观看免费高清国际观察 | 国产精品 中文字幕 亚洲 欧美 | 欧美一区二区激情视频 | X8X8拨牐拨牐X8免费视频8午夜 | 黄色a三级三级三级免费看 黄色a三级免费看 | 国产h视频在线观看免费 | 野花韩国高清完整版在线观看5 | 亚洲性夜夜色综合网站 | 色久久综合视频本道88 | 国产在线亚洲精品观 | 亚洲欧美一级久久精品 | JK白丝校花爽到娇喘视频 | 538视频这里只有精品 | 花蝴蝶在线观看免费中文版高清 | 国产精品久久久久久久久齐齐 | 人与人特黄一级 | 果冻传媒 在线播放观看 |