【发布时间】:2014-01-20 17:52:47
【问题描述】:
我有一个类似于以下代码的操作表:
<ul data-role="actionsheet" id="marketplace-actions" >
<li><a href="#" data-action="getCategoriesByPrice(5)">$$$$$</a></li>
<li><a href="#" data-action="getCategoriesByPrice(4)">$$$$</a></li>
<li><a href="#" data-action="getCategoriesByPrice(3)">$$$</a></li>
<li><a href="#" data-action="getCategoriesByPrice(2)">$$</a></li>
<li><a href="#" data-action="getCategoriesByPrice(1)">$</a></li>
</ul>
操作表由标签条上的标签打开,如下所示:
<div id="marketplace-tabstrip" data-role="tabstrip" style="font-size:125%; vertical-align:top;">
<a href="#marketplace-recent-view" data-icon="font-flash">Just Added</a>
<a href="#marketplace-category-view" data-icon="font-tags">Select Category</a>
<!-- this one --> <a data-rel="actionsheet" href="#marketplace-actions" data-icon="font-dollar">Select Price <span class="km-font-resize-full"/></a>
<a href="#marketplace-sort-view" data-icon="font-sort-alt-up">Change Order</a>
<a href="#marketplace-location-view" data-icon="font-location">Change Location</a>
</div>
点击动作时应该触发的函数是:
function getCategoriesByPrice(price) {
console.log("function getCategoriesByPrice() called");
console.log("filter Categories by: " + price);
}
我的问题是,当我单击 tabstrip 按钮时,无论当前选择的选项是默认还是最近选择的,都会触发该选定选项的数据操作事件。这是默认行为吗?这是我可以覆盖的吗?我宁愿操作表什么都不做,只有在我更改选择时才会触发。
【问题讨论】:
标签: javascript kendo-ui kendo-mobile