Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141228 | Nov 30,2018 08:46 AM UTC | Nov 30,2018 12:31 PM UTC | ASP.NET MVC - EJ 2 | 8 |
![]() |
Tags: Grid |
@Html.EJS().Grid("Grid").DataBound("dataBound").DataSource((DataTable)ViewBag.FFReport).AllowFiltering().AllowMultiSorting(true).PageSettings(page => page.PageSizes(new List<object>() { 5, 10, 15, 20, 25, 30 })).AllowTextWrap(true).AllowPaging(true).AllowExcelExport(true).AllowResizing(true).Height("400").AllowExcelExport().ToolbarClick("toolbarClick").Toolbar(new List<string>() { "ExcelExport" }).FilterSettings(filter => { filter.Type(Syncfusion.EJ2.Grids.FilterType.Excel); }).AllowGrouping(false).Render()
<script>
function dataBound() {
for (var i = 0; i < this.columns.length; i++) {
if (this.columns[i].type == 'date' || this.columns[i].type == 'datetime') {
this.columns[i].format = { type: 'date', format: 'dd/MM/yyyy' };
}
}
this.refreshColumns();
}
</script>
|
@Html.EJS().Grid("Grid").Load("load").DataBound("dataBound").DataSource((DataTable)ViewBag.FFReport).AllowFiltering().AllowMultiSorting(true).PageSettings(page => page.PageSizes(new List<object>() { 5, 10, 15, 20, 25, 30 })).AllowTextWrap(true).AllowPaging(true).AllowExcelExport(true).AllowResizing(true).Height("400").AllowExcelExport().ToolbarClick("toolbarClick").Toolbar(new List<string>() { "ExcelExport" }).FilterSettings(filter => { filter.Type(Syncfusion.EJ2.Grids.FilterType.Excel); }).AllowGrouping(false).Render()
<script>
var initialLoad = false;
function load() {
initialLoad = true;
}
function dataBound() {
if (initialLoad) {
initialLoad = false;
for (var i = 0; i < this.columns.length; i++) {
if (this.columns[i].type == 'date' || this.columns[i].type == 'datetime') {
this.columns[i].format = { type: 'date', format: 'dd/MM/yyyy' };
}
}
this.refreshColumns();
}
}
</script>
|
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.