[AC-1415] TableViewRow - longpress event doesn't work properly
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2014-07-15T16:54:22.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | longclick, tableview, tableviewrow |
Reporter | Matej |
Assignee | Mauro Parra-Miranda |
Created | 2014-05-25T21:36:41.000+0000 |
Updated | 2016-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();
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
I know that, the problem is that longpress event does work ,but only if there is another longpress event added to a TableView.
Invalid bug.