-
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
Grid columns headers have no width on refresh #2193
Comments
I think you're correct that the grid is deciding the columns are the same and (at least partially) trying to reuse the previous column def. I think that's a bug, but will require some diagnosis. In the interim, you can work around this by emptying the column defs, using an interval to wait for a digest cycle to run, then repopulating them, like this: http://plnkr.co/edit/5oKw1m2CBM4iCjTzu6tI?p=preview |
Very cool, thanks for the workaround. |
@PaulL1 - I'm glad I found this thread with a work-around for the problem as I was dire to have it working. I would highly suggest to make this piece of knowledge available on the Tutorial pages until it gets fixed. I have actually used $timeout instead of $interval to achieve the same result: $timeout(function() {
$scope.grid.config.columnDefs = columnDefs; // update grid columns
$scope.grid.config.data = results; // update grid data
}); As a side note. There was another issue sort of related to column replacing. If you configure your grid with: enableRowSelection: true,
enableRowHeaderSelection: true,
multiSelect: true, and then decide to replace columns and data in the grid, then the viewport would get pushed by the vertical bar with checkmarks below. There were 2 solutions I found to this:
.ui-grid-viewport {
width: auto !important;
}
position: relative; Hope this helps someone. |
This is so way too cool - I was completely lost the whole of Sunday night trying to get this to work... This thread definitely needs to be made popular!!! |
Looks like this is working properly so I'm going to close. If there's any further issues please file a new ticket, thanks! |
My apologies to comment on closed issue, however I am facing this issue still. Any suggestion ? I am using ui-grid version v3.0.0-rc.21 |
Ignore my previous comment. Resolution: Changing ColumnDefs to have "name" instead of "field" solved the issue. Not sure of root cause though. |
how to give array data into |
Yup. I'm getting the same issue as firstpin; tried the resolution on here to no avail. |
We have an app where we change the columns of the grid often, we do this by building a list of columns from the data property keys.
plunker example: http://plnkr.co/edit/RDEC8e?p=preview
I've noticed that in our app, the column headers get classes dynamically added to them like
.grid1416592787863 .ui-grid-coluiGrid-082
and on the columns that are correctly drawn these classes are what gives the headers their width and on the columns that are drawn incorrectly they do not.I am experimenting with using a custom headerTemplate to enforce the header width but I am still working on getting the header to play nice with the rest of the grid's concept of the column width.
The text was updated successfully, but these errors were encountered: