- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
背景:我在所有 View 中使用相同的工具栏,该工具栏是在单独的 View 中定义的。该工具栏有四个按钮。由于该按钮具有 'id' 属性, View 中一个按钮上的点击事件也会触发其他 View 中类似的点击事件,因为跨 View 使用相同的工具栏。
我的工具栏如下。
Ext.define("WU.view.WUToolBar", {
extend: "Ext.Toolbar",
alias: "widget.wuToolBar",
xtype:"wuToolBar",
config: {
docked : 'bottom',
cls : 'tabBar',
ui:'widgetBottombarUI',
items : [
{
xtype : 'button',
text : 'My Account',
cls : 'profileTabBar',
id : 'myProfileButton',
listeners : {
tap : function(button, e, eOpts) {
console.log('myProfileButton is clicked');
}
},
{
xtype : 'button',
text : 'Help',
cls : 'helpTabBar',
id : 'helpTabButton',
listeners : {
tap : function(button, e, eOpts) {
console.log('helpButton is clicked');
}
},
]
},
});
我将其添加到项目配置中的不同 View 中,如下所示。
xtype : 'wuToolBar'
因此,单个 View 中按钮上的点击事件将触发所有 View 中的点击事件,因为此工具栏是跨页面共享的。如果我要删除id 属性,然后应用程序工作正常,但我需要将 id 分配给按钮,因为我必须使用 getCmp
方法访问它们。
最佳答案
如果它存在于所有 View 上,那么我建议将其添加到您的 app.js 中,然后在从一个屏幕移动到另一个屏幕时简单地添加到视口(viewport):
在 app.js 中:
...
launch: function() {
...
// Add static components
Ext.Viewport.add([
{
xtype: 'wuToolBar'
docked: 'bottom' // I would recommend moving this out of your customized config
}
]);
...
},
...
您可以稍后使用相同的方法添加 View (Ext.Viewport.add(...)
),也可以使用 Ext.navigation.View
component .
关于javascript - SenchaTouch 2 : Same toolbar used across the views is firing the same event multiple times,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14991532/
我试图创建 Kindle Fire 模拟器来测试 Kindle Fire 平板电脑、Fire 手机和亚马逊电视的应用程序。我已经按照文档进行操作,但无法为这些创建模拟器。谁能告诉我亚马逊是否支持模拟器
以下代码运行大约需要 20 秒。然而,取消注释 do! 后只用了不到一秒的时间。为什么会有这么大的差异? 更新:使用ag.Add时需要9秒。我已经更新了代码。 open FSharpx.Control
我曾经将图像保存到 fire base storage 它在所有 android 设备上工作但在 amazon fire 上,它抛出错误。 这是日志 W/GooglePlayServicesUtil:
我想为 Fire TV 应用程序进行 Google 登录。不幸的是,我不能为此使用 Google Play 服务,所以我需要解决这个问题。我唯一能想到的就是让登录屏幕成为 uiwebview Goog
我们有 Gem Fire 6 数据,想将其迁移到 Gem Fire 8 数据。为此有哪些可能的选择?我们需要这个,因为我们的客户可能不乐意丢失 Gem Fire 6 服务器中的数据。请指教。 最佳答案
我是 Quartz 的新手,一直在重复作业运行。它们是由两个触发时间重叠的触发器引起的。 是否有任何 Quartz 的“开箱即用”功能可以防止重复触发具有多个附加触发器的同一作业? 或者也许有一些第三
我一直在尝试测试事件,昨天我让它工作了。那是在我开始重构测试代码以防止它过于重复之前。我添加了 setUp 方法调用以使用 ModelFactories 生成假数据。这是昨天在每个测试用例中完成的,并
我想在我关注文本区域之前触发一个事件(即在键盘出现在 iOS 上之前)。 这可能吗? 我处理焦点的代码在这里: $(document).on('focus', 'textarea', function
我使用 HTML5 和 JavaScript 开发了 Fire TV 应用程序。这里我需要识别当前访问的设备是什么。 Amazon Fire TV 或 Amazon Fire Stick。 如何使用
Angular 版本: @angular-devkit/architect 0.803.22 @angular-devkit/build-angular 0.803.22 @a
python包Fire对于从命令行启动 python 脚本非常有用。一件常见的事情是有由多个单词组成的参数,例如可以用 3 种通用方式编写的 cat 的名称: nameofcat name_of_ca
我正在尝试使用 javascript 检测我的网站是否在 kindle fire 移动设备上运行。我试过使用 navigator.userAgent 和 navigator.appVersion 但我
hi This : var fees=document.getElementById("conn"); var btn=document.getE
我在网上查过,但找不到任何东西: 如何摆脱在我正在观看的电影上显示的这个通知圈? 最佳答案 这个东西来自 ES 文件浏览器 只需进入此应用程序 > 设置 然后有一个选项说记录 float 窗口,你只需
我需要知道当用户通过新的 Fullscreen API 进入全屏模式时会触发哪些(DOM)事件。我尝试了这个片段,但它没有触发: jQuery('body').on('fullScreenChange
我试图通过在加载页面时隐藏 webView 来在不同网页的加载之间进行转换。但是,我发现一些图像密集型网站导致 webViewDidFinishLoading 过早触发,当我在此时显示 webView
我的应用程序使用 MVVM 模式。我的 TextBox绑定(bind)到我的 ViewModel 的属性(类型字符串)。 何时 TextBox 的内容通过用户输入更改,我想执行一些验证。 所以,目前,
有谁知道如何检测该应用程序是否在Kindle Fire上运行? 如果在Kindle Fire上运行,我的应用程序需要关闭一些功能,并且我想使用与Google Marketplace相同的版本。 最佳答
如何告诉 jQuery 仅触发一次回调函数? $(document).on('ready turbolinks:load', function callback_function() { co
使用新的HTML音频标签: Your browser does not support the audio element. 在我尝试过的所有浏览器(IE v10,Chrome v23,O
我是一名优秀的程序员,十分优秀!