Sorry about the format. There is no way to edit my post so posting it again.
<div
class
=
"container-fluid"
>
<div
class
=
"row"
>
<div
class
=
"col-xs-18 col-md-12"
>
@(Html.Kendo().Grid<BHEBS.Areas.Admin.Models.ContractModel.businessUnit>()
.Name(
"grid"
)
.Columns(columns =>
{
columns.Bound(p => p.Id).Filterable(
false
).Width(50);
columns.Bound(p => p.BU_Id);
columns.Bound(p => p.Description);
columns.Bound(p => p.StartDate).Format(
"{0:MM/dd/yyyy}"
);
columns.Bound(p => p.EndDate).Format(
"{0:MM/dd/yyyy}"
);
columns.Bound(p => p.Fund);
columns.Command(command => command.Custom(
"Edit"
).SendDataKeys(
true
).Click(
"editClick"
));
columns.Command(command => command.Custom(
"View"
).SendDataKeys(
true
).Click(
"viewClick"
));
columns.Command(command => command.Custom(
"Delete"
).SendDataKeys(
true
).Click(
"deleteClick"
));
})
.Pageable()
.Sortable()
.Scrollable()
.Filterable()
.Selectable()
.HtmlAttributes(
new
{ style =
"height:350px;"
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action(
"BU_Read"
,
"Contract"
).Data(
"additionalInfo"
))
)
.ToolBar(toolbar =>
{
toolbar.Template(@<text>
<div
class
=
"toolbar"
>
<button
class
=
"k-button k-button-icontext k-grid-add k-primary"
>Add Business Units</button>
</div>
</text>);
})
)
</div>
</div>
</div>
@(Html.Kendo().Window()
.Name(
"window"
)
.Title(
"About Alvar Aalto"
)
.Content((Html.Kendo().Grid<BHEBS.Areas.Admin.Models.ContractModel.businessUnit>()
.Name(
"grid"
)
.Columns(columns =>
{
columns.Bound(p => p.Id).Filterable(
false
).Width(50);
columns.Bound(p => p.BU_Id);
columns.Bound(p => p.Description);
columns.Bound(p => p.StartDate).Format(
"{0:MM/dd/yyyy}"
);
columns.Bound(p => p.EndDate).Format(
"{0:MM/dd/yyyy}"
);
columns.Bound(p => p.Fund);
columns.Command(command => command.Custom(
"Edit"
).SendDataKeys(
true
).Click(
"editClick"
));
columns.Command(command => command.Custom(
"View"
).SendDataKeys(
true
).Click(
"viewClick"
));
columns.Command(command => command.Custom(
"Delete"
).SendDataKeys(
true
).Click(
"deleteClick"
));
})
.Pageable()
.Sortable()
.Scrollable()
.Filterable()
.Selectable()
.HtmlAttributes(
new
{ style =
"height:350px;"
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action(
"GetAllBU_Read"
,
"Contract"
))
)).ToHtmlString()
)
.Draggable()
.Resizable()
.Width(600)
.Visible(
false
)
.Actions(actions => actions.Pin().Minimize().Maximize().Close())
.Events(ev => ev.Close(
"onClose"
))
).Render();
$(document).ready(function(){
$(
'#second'
).kendoWindow({
width:200,
position:{
left:300
},
visible:
false
});
$(
"#undo"
).bind(
"click"
, function() {
$(
"#window"
).data(
"kendoWindow"
).open();
$(
"#undo"
).hide();
});
$(
'button'
).click(function(){
alert(
"inside"
);
$(
"#window"
).data(
"kendoWindow"
).open();
});
});
public
ActionResult BU_Read([DataSourceRequest]DataSourceRequest request,
int
Id)
{
return
Json(BHEBS.Areas.Admin.Models.ContractModel.GetAllBU(Id).ToDataSourceResult(request));
}
public
ActionResult GetAllBU_Read([DataSourceRequest]DataSourceRequest request)
{
return
Json(BHEBS.Areas.Admin.Models.ContractModel.GetBU().ToDataSourceResult(request));
}