Base solution for your next web application
Open Closed

Edit Modal #2824


User avatar
0
asrar created

Hi,

Pardon me as am still new to Angular. I am trying to create an Edit Modal for Tenancy. I have created the cshtml and js files. I have added the edit button on the listing page and can get the row id as well. I have added the following code in index.js:

vm.openTenantEditModal = function (tenant) { var modalInstance = $uibModal.open({ templateUrl: '/App/Main/views/tenants/editModal.cshtml', controller: 'app.views.tenants.editModal as vm', backdrop: 'static' }); };

I do hit this function but for some reason the modal is not displayed, no javascript errors are also displayed. In editModal.js I did a consol.log to see if it hits the js file but no luck.

Am i missing something please?


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

    Hi,

    Your code seems correct for opening a modal but in order to edit a tenant you also need to send tenant's id to modal. Maybe this is the problem.

    ....
    backdrop: 'static',
    resolve: {
        tenantId: function () {
            return tenant.id;
        }
    }
    ...
    
  • User Avatar
    0
    asrar created

    Hi,

    Thanks for the response. There was an error in the js file that was causing the issue but thats sorted out.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks for the feedback :)