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
我的 gsp 选择标签:
<g:select id="fromLogicalDockGroupId" multiple="true" name="fromLogicalDockGroupId" optionKey="id" optionValue="name" from="${dockGroups}" class="select2 multiSelect" ng-model="taskCreateForm.fromLogicalDockGroupId" />
现在应用 Controller 中选定的值
$scope.taskCreateForm=data;
适用于的数据对象值
fromLogicalDockGroupId: Array[2]
0: "2"
1: "1"
length: 2
__proto__: Array[0]
预期输出:
最佳答案
它看起来不像是 Grails 特有的问题,要么你必须使用 Angular 来完成它,要么一些 JavaScript 代码会为你完成它。
g:select 将值作为参数,我们将显示该值已被选中。
关于javascript - 如何在grails <g :select using angularjs中为multi select2标签元素设置多个值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32754424/