Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2954] SearchBar cancel event not fired

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2011-06-25T04:35:30.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterJeroen van Vianen
AssigneeTony Guntharp
Created2011-06-10T14:30:44.000+0000
Updated2016-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.

Comments

  1. Paul Dowsett 2011-06-13

    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
  2. Jeroen van Vianen 2011-06-14

    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.
  3. Paul Dowsett 2011-06-25

    Closing, as per reporter's request.
  4. Paul Dowsett 2011-08-16

    Closing after 30 days of inactivity.

JSON Source