-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Lazy options loading! #1174
Comments
+1 |
3 similar comments
+1 |
+1 |
+1 |
+1. Has anyone found any useful workarounds in the meantime? I've just had a requirement for this where we have lots of filters (ui-select elements) on a single page but very few will be used per request. It's wasteful to load the values for these filters until they're actually used. |
|
Isn't refresh called as the control renders, with refresh-delay simply affecting how quickly? My testing seemed to confirm that.. |
My mistake, you're right. I have removed my answer not to confuse people skimming thought the issue. |
+1 |
+1 |
1 similar comment
+1 |
That would be much appreciated indeed ! |
+1 |
I think this would solve your issue wiki, so you would pass the initial data when rendered the first time and then your open-close callback would fetch the data from the server. |
As the PR #1845 is merged please verify if it fix your problem. |
Hi, this is more of an open question and a feature request, rather than an "issue report".
What I would like is a way to lazily load all of the select options the first time when the user opens up the menu. Initially there is only one single preselected item, or a text in the select-box, and when the user clicks the dropdown open, a spinner appears as options are loaded.
I have searched the web for solutions for this, but found non satisfactory. I have thought of various ways to do this, but I understand it might even be tricky to listen to the open event from the ui-select. (there are some far fetched solutions for this I found). And If I am to populate the "unloaed" option list with a single non-selectable spinner option, I dont know how to swap it for the real option list once the loading is complete. My attempts at combining ng-if or ng-show with ui-select-choices did not turn out well.
So I am pretty much stuck here.
Does anyone have a workaround for this. But perhaps even better, if ui-select could support this out of the box, it would be even better.
The text was updated successfully, but these errors were encountered: