Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Adds ability to cancel repeater search #1764

Merged
merged 5 commits into from
Mar 21, 2016
Merged

Adds ability to cancel repeater search #1764

merged 5 commits into from
Mar 21, 2016

Conversation

scott-joe
Copy link
Contributor

Fixes #1733

  • Added pending state to Search
  • Added allowsCancel option to Search. Defaults to FALSE
  • Repeater initializes Search with allowsCancel: TRUE
  • On search, Search issues searchChange event to Repeater. Repeater disables Search, which with the allowsCancel option, does not disable the button. When Repeater is finished rendering, the rendered event is pushed to Search, removing the pending status and class. This returns the button to Clear functionality. If the button is pushed during pending status, the canceled event is pushed to Repeater. Repeater receives this event, and pushes it's own event out for the datasource to handle the cancelation of the XHR request or simply ignoring the results. Meanwhile, a render is performed and Search is cleared as normal.
  • Attempted to write a unit test for this, but the existing unit tests don't seem to perform all 3 cases, so I'll need advising on how this was intended to work, and how I can fix both perhaps.
  • Docs PR to follow after solution is merged

@futuremint futuremint self-assigned this Mar 16, 2016
@@ -76,7 +76,8 @@
this.$pageSize.selectlist();
this.$primaryPaging.find('.combobox').combobox();
this.$search.search({
searchOnKeyPress: this.options.searchOnKeyPress
searchOnKeyPress: this.options.searchOnKeyPress,
allowCancel: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that the search in the repeater will always be cancelable. Should we also support overriding this option on repeater for someone who does not want repeater searches to be cancelable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tech specs didn't cover whether it should always be cancelable, so allowing cancels seemed the less dangerous assumption. I can definitely allow passthrough for Repeater if you'd like it to.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its fine for now, we'll add it later if someone asks for it to be disabled.

@scott-joe
Copy link
Contributor Author

Made the requested changes.

futuremint added a commit that referenced this pull request Mar 21, 2016
Adds ability to cancel repeater search
@futuremint futuremint merged commit 9645d70 into ExactTarget:master Mar 21, 2016
@futuremint futuremint modified the milestone: 3.14.3 Mar 22, 2016
@chriscorwin chriscorwin modified the milestones: 3.14.3, 3.15.0 Mar 29, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to cancel repeater search
3 participants