How to transfer selected data from a table to a new table (angular js)

Published

I have data in the table (users) that you can select. You need to display the selected data in another table, ie the users I selected.
Here’s a feature that opens a modal window and then remembers where we clicked (who we chose).

modalForAssign.result.then(function (selectedContacts) {
                var callContacts = _.map(selectedContacts, function (accountUser) {
                    return accountUser.Id;
                });
                var accountUser = _.map(selectedContacts, function (accountUser) {
                    return accountUser;
                });
                var currentData =
                    $scope.multipleContactIds.concat(callContacts).filter((v, i, a) => a.indexOf(v) === i);
                var controlData = currentData.concat(accountUser);
                if (!$scope.multipleContactIds) $scope.multipleContactIds = [];
                $scope.multipleContactIds = $scope.multipleContactIds.concat(callContacts).filter((v, i, a) => a.indexOf(v) === i);;
                //   var allContacts = $scope.multipleContactIds.concat(callContacts).filter((v, i, a) => a.indexOf(v) === i);  

            }, function () {

            });

HTML: we need to output data to this widget, but now the id is displayed in the list.

        <ul>
            <li ng-repeat='i in multipleContactIds'>{{i}}</li>
        </ul>

        <div ng-if="!isCoaching">
            <grid-widget widget-opts="{ title: 'Common_User', id: 'usersTableWidget', excludeToolbars: false}"
                         grid-opts="{ modelName: 'accountUser', viewModelName: 'noActions', viewModelName: 'userSync' }" />
        </div>

Source: AngularJS Questions

Answers

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq