Sencha touch SenchaTouch OnisticLosure 2图标
我有一个列表,我希望使用Sencha touch SenchaTouch OnisticLosure 2图标,sencha-touch,extjs,sencha-touch-2,Sencha Touch,Extjs,Sencha Touch 2,我有一个列表,我希望使用onistisclosure每行有两个图标。我该怎么做呢?我不知道如何在两个图标上实现onimdisclosure(),但这可能会对您有所帮助。 在下面的示例中,我在每个项目列表中放置了一个图像,并且在项目点击事件中提供了功能。这将用于使用单个项目列表执行多个任务。 //demo.js Ext.define("Stackoverflow.view.demo", { extend: "Ext.Container", requires:"Ext.dataview.List
onistisclosure
每行有两个图标。我该怎么做呢?我不知道如何在两个图标上实现onimdisclosure(),但这可能会对您有所帮助。
在下面的示例中,我在每个项目列表中放置了一个图像,并且在项目点击事件中提供了功能。这将用于使用单个项目列表执行多个任务。
//demo.js
Ext.define("Stackoverflow.view.demo", {
extend: "Ext.Container",
requires:"Ext.dataview.List",
alias: "widget.demo",
config: {
layout: {
type: 'fit'
},
items: [
{
xtype: "list",
store: "store",
itemId:"samplelist",
loadingText: "Loading Notes...",
emptyText: "<div class=\"notes-list-empty-text\">No notes found.</div>",
onItemDisclosure: true,
itemTpl:"<div class='x-button related-btn' btnType='related' style='border: none; background: url(\"a.png\") no-repeat;'></div>"+
"<div class=\"list-item-title\">{title}</div>"
grouped: true
}
],
listeners:
[
{
delegate: "#samplelist",
event: "disclose",
fn: "onDiscloseTap"
}
]
},
onDiscloseTap: function (list, record, target, index, evt, options) {
this.fireEvent('ondisclosuretap', this, record);
}
});
//app.css
.related-btn
{
width: 100px;
height: 100px;
position: absolute;
bottom: 0.85em;
right: 2.50em;
-webkit-box-shadow: none;
}
希望这对您有所帮助。再见。这是可能的,但并不容易。简而言之,您必须扩展类和/或。您可以通过在列表项的itemTpl内手动添加一个公开图标来完成此操作。在视图中添加以下内容:
{
xtype: 'list',
onItemDisclosure: true,
cls: 'my-list-cls',
itemTpl: [
'<div class="x-list x-list-disclosure check-mark" style="right: 48px"></div>'
]
}
这将控制新披露图标的样式。
通过设置内容:“3”代码>,您正在将图标从默认的右箭头更改为选中标记。(请参见此处的所有可用图标:)
结果:
这是可能的,但并不容易。简言之,您必须扩展类和/或@olegtaranenko,请将您的评论作为答案发布,以便正确关闭我的问题。谢谢
{
xtype: 'list',
onItemDisclosure: true,
cls: 'my-list-cls',
itemTpl: [
'<div class="x-list x-list-disclosure check-mark" style="right: 48px"></div>'
]
}
.my-list-cls {
.x-list.check-mark.x-list-disclosure:before {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
content: '3';
font-family: 'Pictos';
color: #fff;
text-align: center;
text-shadow: 0 0 0;
}
}