Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146197 | May 22,2018 10:53 AM UTC | Jul 25,2019 02:23 PM UTC | ASP.NET MVC - EJ 2 | 7 |
![]() |
Tags: Grid |
@(Html.EJ().Grid<EmployeeView>("Grid")
.....
.ShowSummary()
.SummaryRow(row =>
{
row.Title("Maximum").SummaryColumns(col => { col.SummaryType(SummaryType.Maximum).DisplayColumn("EmployeeID").DataMember("EmployeeID").Add(); }).Add();
})
) |
@(Html.EJ().Grid<EmployeeView>("Grid")
.....
.ClientSideEvents(eve => { eve.ToolbarClick("click"); })
)
<script>
function click(args) {
args.model.columns[1].defaultValue = ej.max(args.model.dataSource, "EmployeeID").EmployeeID + 1;
}
</script> |
<ej-grid id="Grid" datasource=ViewBag.parent query-cell-info="info">
.....
</ej-grid>
<script>
function info(args) {
console.log(args.cell);
//place your code here...
}
</script> |
export class Default extends SampleBase {
load(args) {
isInitialLoad = true;
}
dataBound(args) {
if (isInitialLoad) {
isInitialLoad = false;
var gridCol = []
this.grid.columns.map(function (cols, index) {
if (index % 2 == 0) {
//based on your condition define the column in grid model
gridCol.push({ field: cols.field, width: 90 })
}
})
this.grid.columns = gridCol; // Provide dynamically created columns to Grid
this.grid.refreshColumns();
}
}
render() {
return (<div className='control-pane'>
<div className='control-section'>
<GridComponent load={this.load.bind(this)} dataBound={this.dataBound.bind(this)} ref={g => this.grid = g} dataSource={orderDetails} height='350'>
</GridComponent>
</div>
</div>);
}
}
render(<Default />, document.getElementById('sample')); |
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.