Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146519 | Aug 7,2019 12:06 AM UTC | Aug 19,2019 07:25 AM UTC | JavaScript - EJ 2 | 8 |
![]() |
Tags: Grid |
[index.js]
var grid = new ej.grids.Grid({
dataSource: data,
gridLines: 'Both',
columns: [
{ field: 'CustomerName', headerText: 'Customer Name', width: 150, textAlign: 'Left', customAttributes: { 'class': 'customcss' } },
...
]
});
------------------------------------------------------------------------------------------------
[index.html]
<style>
.e-grid .e-rowcell.customcss {
padding-top: 0px !important;
}
.e-grid .e-headercell.customcss {
padding-bottom: 20px !important;
}
</style>
|
[index.js]
var grid = new ej.grids.Grid({
….
columns: [
{ field: 'CustomerName', headerText: 'Customer Name', headerTextAlign: "Center", width: 150 }
...
]
});
|
var grid = new ej.grids.Grid({
dataSource: data,
allowPaging: true,
columns: [
{ field: 'OrderID', headerText: 'Order ID', width: 120, customAttributes: {class: 'orientationcss'} },
{ field: 'CustomerName', headerText: 'Customer Name', width: 150 },
]
});
grid.appendTo('#Grid');
<style>
.orientationcss .e-headercelldiv {
padding-top: 10px;
text-align: right;
}
</style> |
[index.js]
var grid = new ej.grids.Grid({
dataSource: data,
allowPaging: true,
columns: [
{ field: 'OrderID', headerText: 'Order ID', width: 120, customAttributes: { class: ['orientationcss', 'customcss'] } },
{ field: 'CustomerName', headerText: 'Customer Name', width: 150 },
]
});
---------------------------------------------------------------------------------------------------------------
[index.html]
<style>
.orientationcss .e-headercelldiv {
padding-bottom: 20px;
text-align: left;
}
.e-grid .e-rowcell.customcss {
padding-top: 10px;
padding-bottom: 0px;
text-align: right;
}
</style>
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.