Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select row plugin not work with ajax #395

Closed
Alvise88 opened this issue May 6, 2015 · 3 comments
Closed

Select row plugin not work with ajax #395

Alvise88 opened this issue May 6, 2015 · 3 comments

Comments

@Alvise88
Copy link

Alvise88 commented May 6, 2015

There is a problem with safeCopy. When table controller is starting the var safeCopy is not properly setted. The solution is that:

Add to the stTableController this code:

this.safeCopy = function(){
copyRefs(displayGetter($scope));
};

And the post link of pipe directive must become:

post: function (scope, element, attrs, ctrl) {
ctrl.pipe();
ctrl.safeCopy(); //The function added before
}

Otherwise the function "function select (row, mode)" will see var rows void.

@Alvise88
Copy link
Author

Alvise88 commented May 6, 2015

The issue was not resolved by previous message due the asynchronous nature of pipe.

with the following piece of code at the end of stTableController i have resolved my problem:

$scope.$watch($attrs.stTable, function() {
safeCopy = copyRefs(displayGetter($scope));
});

@changtung
Copy link

This solution worked also for me.

@lorenzofox3
Copy link
Owner

duplicate of #390

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants