Base solution for your next web application
Open Closed

pass data to create modal box from grid #1929


User avatar
0
avanekar02 created

Hello on clicking createnew i wish to pass some default data from the parent page to the create uimodal

do you have a workaround for this


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can pass data like this,

    $uibModal.open({
        templateUrl: '~/App/common/views/users/createOrEditModal.cshtml',
        controller: 'common.views.users.createOrEditModal as vm',
        backdrop: 'static',
        resolve: {
            userId: function () {
                return userId;
            }
        }
    });
    

    then get it in modal like this,

    (function () {
        appModule.controller('common.views.users.createOrEditModal', [
            '$scope', '$uibModalInstance', 'abp.services.app.user', 'userId',
            function ($scope, $uibModalInstance, userService, userId) {
            ....
            }
        ]);
    })();