Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1415] TableViewRow - longpress event doesn't work properly

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2014-07-15T16:54:22.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelslongclick, tableview, tableviewrow
ReporterMatej
AssigneeMauro Parra-Miranda
Created2014-05-25T21:36:41.000+0000
Updated2016-03-08T07:37:50.000+0000

Description

I am a little bit confused right now because the documentation doesn't include anything about "longpress" event for a TableViewRow. The problem is that it works ,but only if event listener is added to a TableView otherwise it is ignored and it shouldn't be. *index.js*
$.row.addEventListener("longpress", function(e){
	console.log("ROW LONGPRESS EVENT FIRED, ROW ID: ", e.index);
});

$.index.open();
*index.xml*
<Alloy>
    <Window>
        <TableView id="table">
            <TableViewRow id="row" title="A"/>
            <TableViewRow title="B"/>
            <TableViewRow title="C"/>
        </TableView>
    </Window>
</Alloy>

Steps:

1. Try to hold your finger / cursor on the first row. No event will be fired. 2. Modify the index.js file and repeat the first step. In this case everything works as expected however the problem is that $.table.addEventListener is completely pointless. *Modified index.js*
$.table.addEventListener("longpress", function(e) {
	console.log("TABLE LONGPRESS EVENT FIRED, ROW ID: ", e.index);
});

$.row.addEventListener("longpress", function(e) { // Only the first row for test purpose
	console.log("ROW LONGPRESS EVENT FIRED, ROW ID: ", e.index);
});

$.index.open();

Comments

  1. Ritu Agrawal 2014-06-12

    longpress event is available on TableView but not on TableViewRow. Here is the documentation link: http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.TableViewRow You should add longpress event handler on TableView itself and use rowindex property to determine the row number. http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.TableView-event-longpress
  2. Matej 2014-06-13

    I know that, the problem is that longpress event does work ,but only if there is another longpress event added to a TableView.
  3. Mauro Parra-Miranda 2014-07-15

    Invalid bug.

JSON Source