Zizzamia / ng-tasty

A tasty collection of reusable UI components for Angular, like grandma used to make. Like Table directive, WebSocket / Debounce / Throttle service, Range / Camelize / Slugify filters
MIT License
434 stars 64 forks source link

Reload callback not working #215

Open darkmakukudo opened 8 years ago

darkmakukudo commented 8 years ago

Hi,

The list is not updating when I trigger reload callback function after modal close.

// Inside my view
 <div tasty-table
             bind-resource-callback="showStudents.loadAllStudentsRecords"
             bind-init="showStudents.init"
             bind-reload="reloadCallback"

// Inside my controller
...
Other implementations here
...
vm.reloadCallback = function () { alert("Called"); };

vm.delete = function (studId) {

        // Show modal
        var modalInstance = $uibModal.open({
            templateUrl: 'AppScripts/Views/Student/DeleteStudent.html',
            controller: 'DeleteStudentCtrl as deleteStudent',
            backdrop  : 'static',
            keyboard  : false,
            resolve: {
                studentId: function () {
                    return studId;
                }
            }
        });

        modalInstance.result.then(function (status) {
            if (status === 'ok')
            {
                vm.reloadCallback();
            }
        });

The alert was executed when i call the reloadCallback function but the list is not updated By the way im using "controller as" syntax.

darkmakukudo commented 8 years ago

I also tried to remove first the modal implementation so i will stay on the same controller, but reloadCallback still not working

Disane87 commented 8 years ago

Is your callback firering? If I add the atrribute bind-reload="reloadCallback" to my table, the entire table will not be rendered:

image

or did you have a solution?

ghost commented 7 years ago

i also have this issue anyone found solution on this ? please help

dv9 commented 7 years ago

hi, i have the same problem....