How I can display the second word of header in column?
Now kendo grid doesnt show symbols which dont place in header
I want
Second
First
But now
Second Fi
Just add this CSS to allow the column header text to wrap when column width too small to display all words:
th.k-header{
white-space: normal !important;
}
DEMO
Related
Using the ui-grid with great success with 3 nested levels. Business needs an expanded row to push down then next row rather than overlaying on top of successive rows. Not finding how this overflow/z-layer functionality is controlled inside of the ui-grid.js file. Any suggestion on how to get this to work? Thanks!
Figured it out. The ui-grid.js file contains all the templates at the bottom of the 28,000 lines. I pulled all the html for "ui-grid/expandableRow" into its own template file in my code and modified it to meet some needs. In the angularjs, I specify that template as such with my own naming convention:
expandableRowTemplate: 'AngularApp/Templates/expandableAssetsRowTemplate.html'
That templates's code looks like this. I had to remove the directive 'ui-grid-expandable-row' for some strange reason in order to work):
<div ui-grid="row.entity.subGridOptions" ui-grid-pagination ui-grid-expandable ui-grid-edit ui-grid-row-edit ui-grid-cellNav ui-grid-move-columns ui-grid-resize-columns
ng-if="expandableRow.shouldRenderExpand()"
class="expandableRow"
style="float:left; margin-top: 1px; margin-bottom: 1px"
ng-style="{width: (grid.renderContainers.body.getCanvasWidth()) + 'px' , height: row.expandedRowHeight + 'px' }">
</div>
The other thing that affected the outcome is an expandable row height in the parent grid's gridOptions:
expandableRowHeight: 390
The nested grid has a height specification, but this expanded row height allows the parent grid to expand the row to the correct height.
The end result of all this is that my parent grid's rows now expand and the nested grid pushes the rest of the parent rows downward rather then laying over them.
Note: I originally went with a vanilla expandableRowTemplate as found in the tutorials and that is why my expansion wasn't working right.
Sample of a bad template (as compared to the one above):
<div ui-grid="row.entity.subGridOptions" ui-grid-expandable
ui-grid-edit ui-grid-row-edit ui-grid-cellNav ui-grid-move-columns ui-grid-resize-column>
</div>
In my case I have a an ui-grid called myTable and inside it can be some rows of a sub-grid. The main grid is filled with an array array1.
Each element of array1 can contain an array of details.
Only I need to do this operation (to set height attribute of sub-grid):
$scope.myTable.expandableRowHeight *= ( 2 + row.entity.details.length ) ;
row.entity must be an element from array1 (the main grid's array)
Then, the expandCollapse method should be like this:
$scope.expandCollapseRow = function(row,$event){
$event.stopPropagation();
$scope.myTable.expandableRowHeight *= ( 2 + row.entity.details.length ) ;
$scope.gridApi.expandable.toggleRowExpansion(row.entity);
};
Please don't forget that expandableRowHeight is an existing attribute of angular-ui grid.
You can see the attribute into gird setup in this image:
My goal is to build a table using CSS (display:table, table-row, table-cell) with 1 custom polymer-element defining the div for the table, and another polymer-element defining the divs for the rows and cells, like this
<my-table>
<my-row col1="contents of column 1" col2="column 2">
--html for content of column 3--
</my-row>
</my-table>
The problem I'm having is that the div created by with the "display:table;" isn't being recognized by the divs created by with the "display:table-row" and "display:table-cell". The divs created by seem to think they are in their own individual tables.
Is there a way to get this to work? If the answer is to use ::content ::shadow, then I need to be shown how because I can't get it to work and behave as a single large table.
You should style the host of the polymer element, not the divs inside it.
Here is an example: https://gist.github.com/jakemac53/0d073615d723502a61ca
I tried to get a cell to expand it's height dynamically.
Is there a way to adjust the height of a row(GridRow) after it is rendered?
If not, then I will try to use an expandable grid or tree in a grid.
Is it possible to display an expandable grid off a specific cell/column?
Currently I see all expandable grids/tree grids that take up the entire row below the parent.
Thanks
Add this css to your styles:
.ui-grid-viewport .ui-grid-cell-contents {
word-wrap: break-word;
white-space: normal !important;
}
.ui-grid-row, .ui-grid-cell {
height: auto !important;
}
.ui-grid-row div[role=row] {
display: flex ;
align-content: stretch;
}
You can see an answer to the same question here: https://github.com/angular-ui/ng-grid/issues/3239#issuecomment-91045267
UI-Grid virtualizes the rows, meaning that it only renders a small subset of the data, and leaves everything that wouldn't be in view unrendered. This means the grid needs to know how tall every row is, so that it can calculate positioning.
If it had to measure every row when rendered this would cause the browser to repaint over and over and performance would be miserable.
You'll find that other virtualized tools (like Ionic's collection-repeat) have the same limitation.
Update:
To answer your second question: you can set a height property on the GridRow object (not your entity, you can use getRow from the grid API to get the GridRow object) and the grid will use this height when rendering the row.
And your third question: no, expandable is only built to work off entire rows. It might be possible to alter what sort of data is displayed in a sub-grid based on clicks in certain cells, but that would require some changes to the expandable code.
I have a table where my column headers are set with the following instruction :
table.setColumnHeader
I wonder how can I create multilevel table headers like on this page?
As of Vaadin 6.7.3, this is currently not possible using the stock Vaadin table component.
There is a Trac issue raised for changing this for Vaadin 7. See https://vaadin.com/forum/-/message_boards/view_message/900369 for more details.
Depending on your requirements, you could hide the table component's header and try to simulate the header (by using a HorizontalLayout, generating your own headers and listening to column resize events); alternatively, you could simply generate your own HTML <table></table> and assign it to a label component.
In Vaadin7 you can set the table header height dynamically by adding following CSS rule to your theme:
.v-table-header-wrap {
height: auto;
}
The only think is that the column separator is not set to 100% of the header row height ...
A look into the TreeTable component may help you :
Vaadin sampler
Regards,
Éric.
To make a header only of a table use setPageLength(0); this will eliminate the table body and show only the header.
Then create another table with a header and your data and combine these 2 in a layout :)
It's a cool trick, be sure to match the ratio's of first header with the second's table header.
i m using a jqgrid on asp.net mvc... i have a specific requirement....The data in the grid is list of values that are to be set on each row... and each row has a Date column... While displaying the grid, i want a different row color on sunday and saturday.. while the rest of the rows are white.. How to achieve this in jquery jqgrid?
You can "bring colors" in your grid with respect of setCell method of jqGrid (see this answer as an example) or jQuery.addClass, jQuery.css (see this and this). You should do this after the grid contain is loaded, for example, inside of your loadComplete event handler.
If you want set background-color style on the cell you should understand one small problem. The class 'ui-widget-content' used for every grid row already defines the background-color per background style (!!! not per background-color). So to have effects you should make changes of the background-color style in one from the following ways: 1) just use background: yellow instead of background-color: yellow (see this). 2) remove 'ui-widget-content' class with jQuery.removeClass('ui-widget-content') (see this); 3) change style of the row more explicit like $("#"+rowid)[0].style.backgroundColor = "yellow" (see this as an example). Choose the ways which you prefer.