Question

what I want to do is this: I have a tableview and, when I click on a tableviewrow I want this tableviewrow to be disabled so you cannot click it again to fire the event 'click' once again, but I want you to be able to click on any other row from the table.

I've tried this:

e.row.touchEnabled = false;

But it doesn't seems to work.

Hope you can help me.

Thanks ^.^

Here is the code for the 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>

And here is 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;
});
Was it helpful?

Solution

Because the tableView is already created use the set method for that propery:

e.row.setTouchEnabled = false;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top