单击钛后禁用行

时间:2014-02-07 22:49:00

标签: titanium titanium-mobile titanium-alloy

我想要做的是: 我有一个tableview,当我点击tableviewrow时,我希望这个tableviewrow被禁用,所以你不能再次点击它再次点击事件'click',但我希望你能够点击任何其他的一行表

我试过这个:

e.row.touchEnabled = false;

但它似乎不起作用。

希望你能帮助我。

谢谢^。^

以下是TableView的代码

<TableView id="tableBuilding" allowsSelection="true">
                <TableViewRow id="row" selectedBackgroundImage = "/images/bt_select_picker.png">
                    <ImageView id="imgBuilding"/>
                    <Label id="labBuilding" class="labelScroll" text="Building 01" />
                    <ImageView id="imgTransparent6" class="opacity"/>
                    <ImageView id="imgRemove6"  class="remove" onClick="edit"/>
                    <ImageView id="imgHandle6" class="handle" onClick="handle"/>
                </TableViewRow>
                <TableViewRow id="row" selectedBackgroundImage = "/images/bt_select_picker.png">
                    <ImageView id="imgBuilding"/>
                    <Label id="labBuilding" class="labelScroll" text="Building 02" />
                    <ImageView id="imgTransparent7" class="opacity"/>
                    <ImageView id="imgRemove7"  class="remove" onClick="edit"/>
                    <ImageView id="imgHandle7" class="handle" onClick="handle"/>
                </TableViewRow>
                <TableViewRow id="row" selectedBackgroundImage = "/images/bt_select_picker.png">
                    <ImageView id="imgBuilding"/>
                    <Label id="labBuilding" class="labelScroll" text="Building 03" />
                    <ImageView id="imgTransparent8" class="opacity"/>
                    <ImageView id="imgRemove8"  class="remove" onClick="edit"/>
                    <ImageView id="imgHandle8" class="handle" onClick="handle"/>
                </TableViewRow>
                <TableViewRow id="row" selectedBackgroundImage = "/images/bt_select_picker.png">
                    <ImageView id="imgBuilding"/>
                    <Label id="labBuilding" class="labelScroll" text="Building 04" />
                    <ImageView id="imgTransparent9" class="opacity"/>
                    <ImageView id="imgRemove9"  class="remove" onClick="edit"/>
                    <ImageView id="imgHandle9" class="handle" onClick="handle"/>
                </TableViewRow>
                <TableViewRow id="row" selectedBackgroundImage = "/images/bt_select_picker.png">
                    <ImageView id="imgBuilding"/>
                    <Label id="labBuilding" class="labelScroll" text="Building 05" />
                    <ImageView id="imgTransparent10" class="opacity"/>
                    <ImageView id="imgRemove10"  class="remove" onClick="edit"/>
                    <ImageView id="imgHandle10" class="handle" onClick="handle"/>
                </TableViewRow>
            </TableView>

这里是te eventListener

$.tableBuilding.addEventListener('click', function(e) {
    e.row.children[0].image = "/images/ic_selectedbuilding.png";
    e.row.children[1].color = "white";
    e.row.setTouchEnabled = false;
});

1 个答案:

答案 0 :(得分:1)

因为已经创建了tableView,所以使用该方法的set方法:

e.row.setTouchEnabled = false;
相关问题