xeditable格的下拉值不能从外部下拉改变 [英] xeditable Grid's drop down values cannot change from the outside dropdown

查看:236
本文介绍了xeditable格的下拉值不能从外部下拉改变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 xeditable 角directive.I需要设置网格的所有下拉根据外界下拉的值列状态的值。
我已经设置了的jsfiddle这里。但它不是working.Could你告诉我为什么?先谢谢了。

I'm using xeditable angular directive.I need to set the grid's all the drop down values of Status column according to the value of the outside drop down. I have set up the JsFiddle here.But it's not working.Could you tell me Why ? Thanks in advance.

更新:当我点击取消按钮,然后它的updated.Very奇怪:(你能告诉我如何理清这个问题?

Update: When I click the cancel button then it's updated.Very strange :( Could you tell me how to sort out this issue ?

HTML

<span editable-select="bulkPaymentType" e-form="tableform" e-ng-options="s.value as s.text for s in statuses" e-ng-change="setBulkPaymentType($data)">
 </span>

JS

 $scope.setBulkPaymentType = function (data) {
        for (var i = $scope.users.length; i--;) {
            var user = $scope.users[i];
            user.status = data;
        };
    };

的jsfiddle

JSFiddle

推荐答案

我已经找到了solution.Here是:)

I have found the solution.Here it is :)

HTML

HTML

<span editable-select="bulkPaymentType" e-form="tableform" e-ng-options="s.value as s.text for s in statuses" e-ng-change="setBulkPaymentType($data,tableform)">
 </span>

JS

$scope.setBulkPaymentType = function (data,tableform) {
        for (var i = 0; i < tableform.$editables.length; i++) {
            if (tableform.$editables[i].name === 'user.status') {
                tableform.$editables[i].scope.$data = data;

            }
        }
    };

播放它: 的jsfiddle

Play with it : JSFiddle

这篇关于xeditable格的下拉值不能从外部下拉改变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆