TypechoJoeTheme

IT技术分享

统计
文章目录

xeditable 下拉框增加新的值

2017-02-16
/
0 评论
/
776 阅读
/
正在检测是否收录...
02/16

Html

<div editable-ui-select="item.groupName"
         data-e-form="form"
         data-e-name="groupName"
         name="groupName"
         theme="bootstrap"
         data-e-ng-model="item.groupName"
         data-e-style="min-width:200px;">
                {{item.groupName}}
        <editable-ui-select-match>
                {{$select.selected}}
                <div ng-model="selected"></div>
        </editable-ui-select-match>
        <editable-ui-select-choices
                repeat="gn in getGroupNames($select.search) | filter: $select.search track by $index">
                {{gn}}
        </editable-ui-select-choices>
</div>

JS

$scope.getGroupNames = function (search) {
        var newGroupNames = $scope.groupNames.slice();
        if (search && newGroupNames.indexOf(search) === -1) {
                newGroupNames.unshift(search);
        }
        return newGroupNames;
};
朗读
赞 · 0
版权属于:

IT技术分享

本文链接:

https://idunso.com/archives/2537/(转载时请注明本文出处及文章链接)