【问题标题】:Appcelerator Alloy TableView click event is not firing up on parent tableviewAppcelerator Alloy TableView 点击事件未在父 tableview 上触发
【发布时间】:2017-05-24 09:10:35
【问题描述】:

我正在构建一个应用程序,我在 tableview 行中有一个 tableview。

我在主表视图中有一个点击事件,我希望保留它。

 <Alloy>

<Collection src="orders" />
<Window onAndroidback="closeWindow" id="activeorderswindow" class="maincontainer_noactionbar">
    <View class="topcontainer">
        <ImageView class="topbackbutton" onClick="closeWindow"></ImageView>
        <Label class="topheadinglabel">Aktive ordre</Label>
        <ImageView class="topmenubutton" onClick="closeWindow"></ImageView>
    </View>

    <View class="maindatacontainer">
        <TableView class="orderstable" id="activeorderstable" dataTransform="transformFunction" dataCollection="orders" dataFunction="updateUI" onDragEnd="refreshTable" >
        <!-- Also can use Require -->
            <TableViewRow class="activeordersrow" oid="{oid}" touchEnabled="true" >
                <Label class="rowOid" text="{oid}"/>
                <Label class="rowCust" text="{cust}"/>
                <Label class="rowScode" text="{scode}"/>
                <Label class="rowVehicle" text="{vehicle}"/>
                <Label class="rowOrdertime" text="{ordertime}"/>
                <ImageView class="imgOrdertime" image='/images/clock_green.png'/>
                <ImageView class="imgDeadline" image='/images/clock_red.png'/>
                <Label class="rowDeadline" text="{deadline}"/>
                <View class="addresstablewrapper" backgroundColor="#000"/>
                <TableView touchEnabled="false" scrollType="vertical" class="activeorders_addresses" data="{orders_addresses}" backgroundColor="yellow" />
            </TableViewRow>
        </TableView>    
    </View>
</Window>

问题是因为我在表格中有另一个有自己的行(没有点击事件),所以似乎点击主页面没有触发。

帮助表示赞赏:)

谢谢

汤姆

【问题讨论】:

  • 我很少看到在另一个 tableview 中包含一个 tableview 的这种模式。
  • 你为什么要嵌套tableviews,可能你正在寻找实现部分?

标签: titanium tableview appcelerator


【解决方案1】:

也许嵌套的 TableView 应该有 touchEnabled="true" 以便点击冒泡到父级 (tableviewrow)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-07-26
    • 1970-01-01
    • 1970-01-01
    • 2023-03-03
    • 1970-01-01
    • 2012-12-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多