-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Overwrite columnDefs requires new UID to be handled #1948
Comments
Hello. What I can do this in new ui-grid? |
anyone? |
I believe we now support column moving, and that our column order now follows the order in the columnDefs. Are you using the latest code from github, or the version from bower? |
I have the same problem using bower version "3.0.0-rc.14". Even when assigning a new columnDefs array, if it contains the same columns names in different order the grid doesn't update. I was able to temporally fix it by clearing the columns and adding a $timeout call to set the new array: ``` javascript`
|
It doesn't work and I use the latest version. |
@jpuri: were you aware of column moving issues on IE and FF? |
Hey Paul, I got to know about this issue yesterday only by looking at comment in issue #1815. I have already fixed it for FF. I guess it will now work well on IE also but I need to test that, I need a different machine for that, but I will be able to do that today. Thanks a lot for your help with these issue, |
Excellent, thanks for being on top of this @jpuri |
Update: I've tried updating column defs here: http://plnkr.co/edit/DzIdSjTMQ5Rcv5EAG82X?p=preview and there indeed does appear to be a bug. When you overwrite the columnDefs completely, new column UIDs get generated but there isn't any handling within the header-cell/regular-cell directives for altering their classes that are based on those UIDs. The |
Update: this is going to be a more difficult solve than initially thought.
|
i want to change columns position dynamically, so i changed the position of the first column to be the last, but noting happen. i tried to use the api grid.refresh() after the reordering (and also inside $timeout like in 'ui.grid.moveColumns' feature) without success either.
i edit your "all features" plunker and made one that demonstrates my problem.
http://plnkr.co/edit/7qvlbMhL5b24ugeUf8j4?p=preview
To solve the problem i made a work-around:
instead of:
$scope.moveFirstCellToBeTheLast = function () {
var temp = $scope.cols[0];
$scope.cols.splice(0,1);
$scope.cols.push(temp);
}
i wrote:
$scope.moveFirstCellToBeTheLastWorkArround = function () {
var temp = $scope.col1[0];
$scope.col1.splice(0,1);
$timeout(function () { $scope.col1.push(temp); });
}
so the grid "think" that the columns was removed (so it refreshed itself once) and than i add another column so it refreshed itself again.
BUT, all the grid flickered twice, and this work around won't satisfied all the possible situations of programmatically columns reordering.
I want to know if there is a better way to do it (by api for example) or right now this action is not supported?
Thanks a lot,
Oren.
The text was updated successfully, but these errors were encountered: