Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Wait for the first open to first load remote data #271

Closed
diogodomanski opened this issue Oct 8, 2014 · 7 comments
Closed

Wait for the first open to first load remote data #271

diogodomanski opened this issue Oct 8, 2014 · 7 comments

Comments

@diogodomanski
Copy link

Currently, if has "refresh" attribute, its expression is performed as soon as the directive is instanciated.

It would be useful if there was a parameter to inform to perform the "refresh" expression only when the gets focus (and dropdown is opened) or the user changes input value (and taking into account the "refresh-delay" attribute).

@dimirc
Copy link
Contributor

dimirc commented Oct 8, 2014

What about checking if $select.search is empty at the refresh function?

@diogodomanski
Copy link
Author

Problem is that I want to load data when the user first click on the input
field. This action also has empty $select.search.

2014-10-07 22:38 GMT-03:00 Wladimir Coka [email protected]:

What about checking if $select.search is empty at the refresh function?


Reply to this email directly or view it on GitHub
#271 (comment)
.

@dimirc dimirc added this to the 0.8.x milestone Oct 10, 2014
@dimirc dimirc modified the milestones: 0.10.x, 0.8.x Feb 17, 2015
@dimirc
Copy link
Contributor

dimirc commented Feb 17, 2015

Related to PR #625

@wesleycho wesleycho removed this from the 0.10.x milestone Mar 27, 2016
Jefiozie added a commit to Jefiozie/ui-select that referenced this issue Nov 3, 2016
Jefiozie added a commit that referenced this issue Jan 25, 2017
fix(#271) if option is set the refresh function is getting the request.
@Jefiozie
Copy link
Contributor

As the PR is merged please verify if it fix your problem. For now I will close the issue if needed you can reopen.

cloudrick pushed a commit to hardcoretech/ui-select that referenced this issue Feb 17, 2017
fix(angular-ui#271) if option is set the refresh function is getting the request.
@DmitryGonchar
Copy link
Contributor

DmitryGonchar commented Mar 15, 2017

@Jefiozie this issue is to have an option to do "first load of remote data on first open of dropdown", not on page init. According to the official demo behavior and the code in the PR, this use case is still not supported. So probably makes sense to leave this issue open

@Jefiozie
Copy link
Contributor

@DmitryGonchar i think this is already possible. When using the refresh="fetchFromServer($select.search, $select.open)" like this you already can verify if the ui-select is open or not. If it is you can load the data you want. Correct me if i'm wrong see also the dicussion here: 1845

@DmitryGonchar
Copy link
Contributor

Thanks. I think this was not mentioned in the docs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants