-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Populate multiple select #333
Comments
same here, well .. I think it is the same problem the ui-select possible values is populated by an async load (angular resource). if you then load the selected values asynchronous or even have them in your $scope the ng-mode for that ui-select is "null" this never happend in ui-select2, switching back since this completly breaks all the code |
here's a working version: http://plnkr.co/edit/R4nFkdZsyrMhCMdSgXNc?p=preview notice:
|
@mastilver The angular.copy was intended, because the selected data comes from an external source and is not related to the current datalist in the $scope. There is also another problem, if you try to select a person in the multiple select and then click on the button, the multiple select becomes empty. |
I was able to work around this by populating my selection array using items from the choices array. Painful and costly if you have many choices but it does work. |
here's a working plunker of @adamkarl-zywave workaround: btw, I think this issue is related to the issue I opened earlier: #332 |
my workaround for the problem: answer is in my directive's scope (transferred to model)
|
In my own code, even if I use a button to re-populate the scoped object, it still doesn't work. I think I might switch to ui-select2 as well, as this issue is just one of a good number of really broken things with this select. Echoing out the model in the html shows that it is populated as expected - really not sure what to do here! Update: I nested my model retrieval within my async choices retrieval and before either of these called, intialised my model to {} which seems to have fixed it. It appeared that the ui-select was binding to its own copy of the model initially otherwise. Not sure if that's an angular weirdness or a ui-select weirdness but it seems to be working ok now |
@bashanam, could you please post a plunker demo for your solution? I am assuming your code is in a controller but I am not sure. Thanks. |
i have one issue when i save data in db it save objectc in array for using ui select |
I need more context info to fully understand your question. However I guess what you sent to the server and what you retrieved from the server are different. Thanks, Steve Sent from Samsung Mobile -------- Original message -------- From: ahmer-yasin [email protected] Date:01-19-2015 10:04 AM (GMT-05:00) To: angular-ui/ui-select [email protected] Cc: stevehu [email protected] Subject: Re: [ui-select] Populate multiple select (#333) — |
this is point to select plan it will save but when i want to edit plan i m retriving data |
let me show you screen shot for code |
the problem is not for saving and retriving |
|
I have record a short video to show you have angular-schema-form-ui-selet Thanks, Steve On Mon, Jan 19, 2015 at 10:18 AM, ahmer-yasin [email protected]
|
Should be solved via #256 |
Hi,
I serialized a form to be able to reload it when needed.
All the single select are repopulated, but not the multiple select, even if the $scope is populated.
Here is a plunker with my issue : http://plnkr.co/edit/vL9L2XWeziTPuX4KxwmP?p=preview (select people in the first input then click "copy selected people")
EDIT : Better example here : http://plnkr.co/edit/vL9L2XWeziTPuX4KxwmP?p=preview
The text was updated successfully, but these errors were encountered: