[AC-2954] SearchBar cancel event not fired
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-06-25T04:35:30.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | Jeroen van Vianen |
Assignee | Tony Guntharp |
Created | 2011-06-10T14:30:44.000+0000 |
Updated | 2016-03-08T07:47:57.000+0000 |
Description
I have a SearchBar and a TableView. The SearchBar is not added as tableview.search = searchbar, because I have custom TableViewRows whose titles do not play nicely with this functionality. Additionally, I want to start with an empty TableView when nothing has been typed in the SearchBar, because the list of possible matches (> 1000 custom TableViewRows) is too long and takes too much time to display on the device.
In the SearchBar's change event listener I update the TableView. This works flawlessly. I expect the TableView to clear when pressing the cancel button in the SearchBar. I do this by adding the following code:
search.addEventListener('cancel', function(event) {
tableview.data = [];
});
This method is not executed when pressing the cancel button and hence my TableView still shows the rows before I pressed cancel. The hintText is shown as expected.
Jeroen Please provide the following in order for us to progress this ticket: * date and build hash of Titanium SDK being used (use the latest 1.7.X available at the time) * provide a proper [Use-case](http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-CreatingGoodUsecases) * a link to the Q&A question that you posted about the problem, where you asked the community for advice about it, as per [The Bug-Reporting Lifecycle](http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-TheBugReportingLifecycle) Also kindly read the [Submitting Bug Reports](http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-SubmittingBugReports) guide in full before raising tickets. Thank you
OK, never mind. Found the issue. When pressing the 'x' in the SearchBar the change event is fired rather than the 'cancel' event. Please close this issue.
Closing, as per reporter's request.
Closing after 30 days of inactivity.