Ext JS工具栏和痕迹导航示例在JSFiddle中不起作用
Ext JS toolbar and breadcrumb example not working in JSFiddle
我是Ext JS的新手,正在尝试使用Ext JS框架(包含在JSFiddle提供的框架和扩展列表中)创建一个JSFiddle)
我的小提琴在这里,可以单独查看输出窗格 这里.
我希望看到一个工具栏,下面有一个面包屑痕迹。 事实上,我什么也没看到。 我已经在不同的浏览器中进行了测试,但仍然无法看到输出。
我想知道为什么我无法在JSFiddle上看到输出。
JSFiddle 直接从 Github 帐户中提取代码,下面复制相关部分以供参考。
Ext.onReady(function(){
var breadcrumbView = Ext.create('Ext.toolbar.BreadCrumbs', {
renderTo: document.body,
gtIconCls:'thread-greaterthan-icon',
removeIconCls:'thread-remove-icon',
crumbCls:'breadCrumb',
width : 700,
onRemoveItem:function( btn ){
//This is called when a user clicks on a crumb. The crumb is an Ext.button.Button, if you passed in
//the optional param 2 to onItemAdded, it will be attached to this btn as _extraData
},
onRemoveSelection:function( aBtn ){
//This is called when a user clicks the > button. The > removes all crumbs abover the > button
//aBtn is an array of the buttons that were removed.
if( aBtn instanceof Array ){
for( var i=0,l=aBtn.length,itm=null; i<l; i++ ){
}
}
}
});
Ext.create('Ext.toolbar.Toolbar', {
renderTo: document.body,
width : 700,
margin : '5 0 0 0',
items : [
{
text : 'Add a crumb',
scope : this,
handler: function() {
var text = prompt('Please enter the text for your crumb. Use commas to list crumbs:');
text = text.split(',');
for( var i=0, l=text.length,itm=null; i<l; i++ ){
itm = text[i];
//This is how you add an item to the breadcrumb view
//Param 1 is some text to show the user
//Param 2 is an optional object to attach to the crumb.
breadcrumbView.onItemAdded(itm.trim(), {});
}
}
}
]
});
});
您的小提琴使用的是 Ext JS 版本 4.1.0,这将失败。 如果将 JSFiddle 使用的 Ext JS 版本更改为 4.1.1 或更高版本,则输出将符合预期。
如果在浏览器中启动开发人员 Web 控制台,然后加载 Fiddle,您将看到脚本失败并显示错误:
ReferenceError: Ext is not defined
这意味着没有定义 Ext JS 的基本对象。 这可能是 JSFiddle 尝试加载 4.1.0 及更早版本的 Ext JS 框架中的一个错误。
相关文章:
- JsFiddle上的鼠标事件不起作用
- 代码在jsfiddle中工作,但在本地服务器中不起作用
- 为什么这在 jsfiddle 中有效,但在我的文档中不起作用
- Ext JS工具栏和痕迹导航示例在JSFiddle中不起作用
- 使用svg.js的代码在JSFiddle.com或我的笔记本电脑中不起作用
- jQuery Slider在我的网站上不起作用,但在JSFIDDLE中起作用
- JQuery侧边栏在此jsfiddle中不起作用
- 代码在jsfiddle上运行良好,但有一个函数在网站上不起作用
- 当我尝试在jsFiddle中暂停并播放时,我的代码可以工作,但它不起作用;我的html页面不起作用
- 按钮在 JSFiddle 中不起作用
- 代码在 jsfiddle 中工作,但在我的网站上不起作用
- 在 jsfiddle 中拖放表中的行不起作用 - angularjs
- 即使我从另一个工作小提琴复制代码,JSFiddle 也不起作用
- jsFiddle显示正确,但一旦在本地运行就不起作用(Javascript)
- 简单的跨域 iframe postMessage 在 jsfiddle 中工作,但在本地不起作用
- 按钮在 jsfiddle 中起作用,但不清除文本编辑器中的有序列表
- Javascript代码在Jsfiddle中工作,但在本地浏览器中不起作用
- 具有相同代码/数据集的Highcharts代码在PHP中工作,但在JSfiddle中不起作用
- JSFiddle 外部资源不起作用
- JSFiddle JavaScript 在 Dreamweaver 中不起作用