Reputation: 197
i am trying to set multiple option value in tag in grails using angularjs. Here the initial select option has loaded through grails.actually here i have work in migrate to angularjs. I have mention code below.and also i am new to grails part..so i don't know how to use angularjs in grails..Can any one give ideas
My gsp select Tag:
<g:select id="fromLogicalDockGroupId" multiple="true" name="fromLogicalDockGroupId" optionKey="id" optionValue="name" from="${dockGroups}" class="select2 multiSelect" ng-model="taskCreateForm.fromLogicalDockGroupId" />
Now apply selected value from controller
$scope.taskCreateForm=data;
data object value for apply to
fromLogicalDockGroupId: Array[2]
0: "2"
1: "1"
length: 2
__proto__: Array[0]
Expected Output:
Upvotes: 0
Views: 497
Reputation: 629
It doesn't look like a grails specific problem, either you have to do it using angular or some javascript code will do it for you.
g:select takes the value as an argument which we will be shown selected.
Upvotes: 1