I have a custom command and when i clicked it, i want to call an ajax function and if it returns, i want it to be disable. I have more than 1000 rows , and i want to refresh only related row.
@(Html.Kendo().Grid<Umki2.Areas.Wlb.ViewModels.VmWlbWeldLogBook>()
.Name(
"grid"
)
.Columns(columns =>
{
columns.Bound(c => c.JointNo).Width(140);
columns.Bound(c => c.WlbJointLocation).Width(190);
columns.Command(command => command.Custom(
"FitUp"
).Click(
"showDetails"
));
})
.HtmlAttributes(
new
{ style =
"height: 380px;"
})
.Scrollable()
.Groupable()
.Sortable()
.Pageable(pageable => pageable
.Refresh(
true
)
.PageSizes(
true
)
.ButtonCount(5))
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action(
"Grid_Read"
,
"WlbExplorer"
))
)
)
@(Html.Kendo().Window().Name(
"Details"
)
.Title(
"Customer Details"
)
.Visible(
false
)
.Modal(
true
)
.Draggable(
true
)
.Width(300)
)
<script type=
"text/x-kendo-template"
id=
"template"
>
<div id=
"details-container"
>
<h2>#= JointNo # #= JointNo #</h2>
<em>#= WlbJointLocation #</em>
<dl>
<dt>City: #= WlbJointLocation #</dt>
<dt>Address: #= WlbJointLocation #</dt>
</dl>
</div>
</script>
<script type=
"text/javascript"
>
var detailsTemplate = kendo.template($(
"#template"
).html());
function showDetails(e) {
e.preventDefault();
var dataItem =
this
.dataItem($(e.currentTarget).closest(
"tr"
));
var wnd = $(
"#Details"
).data(
"kendoWindow"
);
wnd.content(detailsTemplate(dataItem));
wnd.center().open();
}
</script>