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

Disable first refresh call #1197

Open
furyscript opened this issue Sep 17, 2015 · 12 comments
Open

Disable first refresh call #1197

furyscript opened this issue Sep 17, 2015 · 12 comments

Comments

@furyscript
Copy link

Hi all,

I've found a problem in ui-select with binding remote data.
This is my code

<ui-select ng-model="group.selected" theme="bootstrap" ng-disabled="group_disabled" reset-search-input="false">
                <ui-select-match placeholder="Select a group...">{{$select.selected.name}}</ui-select-match>
                <ui-select-choices repeat="group in groups | propsFilter: {name: $select.search}" refresh="refreshGroups($select.search)" refresh-delay="0">
                    <div ng-bind-html="group.name | highlight: $select.search"></div>
                    <small>Description: {{ group.description }}
                    </small>
               </ui-select-choices>
            </ui-select>

I want that the call to remote server starts after user keyup on input and not before.
I see that the call start after the page is loaded

Regards,
FS

@uguryilmaz
Copy link

i need that too.

@furyscript
Copy link
Author

Some news?

@AlexSin15
Copy link

In refresh function try add:
refreshGroups(search){
if(!search) return;
}

@edu2004eu
Copy link

@AlexSin15 I tried that, but if I do it like that, when clicking (ie. focusing) the input, nothing happens except that the arrow disappears, but there is no focus on the input. You have to click the input again to get actual focus.

@ganholete
Copy link

+1

@luzrafaelf
Copy link

+1

1 similar comment
@stepanO
Copy link

stepanO commented Jan 24, 2017

+1

@Jefiozie
Copy link
Contributor

Hi, can maybe somebody have a look at this and make a PR?

@Condor2708
Copy link

+1000000000

@Leftyx
Copy link

Leftyx commented Aug 23, 2017

+1

1 similar comment
@andrewcylaw
Copy link

+1

@aske-cph
Copy link

Solution?
#1845 (comment)

You just both pass the search filter and the open boolean:
refresh="fetchFromServer($select.search, $select.open)"

Then in your fetch function you check if $select.open is true:

 $fetchFromServer = function (filter, isOpen) {
            if (!isOpen) {
                return;
            } 
...
}

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