Skip to content Skip to sidebar Skip to footer

Xeditable Grid's Drop Down Values Cannot Change From The Outside Dropdown

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

Solution 1:

I have found the solution.Here it is :)

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;

            }
        }
    };

Play with it :JSFiddle

Solution 2:

Your setBulkPaymentType method is updating the users in your controller scope. But the value in the editable input is actually a copy from your controller scope. So when you call setBulkPaymentType, you don't see them change. And when you hit cancel button, the form will display with the value in your controller scope which you updated with setBulkPaymentType, that is the reason. I don't think you can modify the $data within each editable directly since they are using isolated scope. There is no way to get access to $data from outside.

Post a Comment for "Xeditable Grid's Drop Down Values Cannot Change From The Outside Dropdown"