or
color: rgb(51,51,51); padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-color: rgb(51,51,51); border-right-color: rgb(51,51,51); border-bottom-color: rgb(51,51,51); border-left-color: rgb(51,51,51); border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; display: block; background-image: none; background-attachment: scroll; background-repeat: repeat; background-position-x: 0%; background-position-y: 0%; background-color: transparent;
@(Html.Kendo().Grid(Model)
.Name("Grid")
.HtmlAttributes(new { style = "height:450px;font-size:.85em;" })
.Columns(columns =>
{
columns.Template(e => { }).ClientTemplate(" ").Width(30).HtmlAttributes(new { style="vertical-align: middle; text-align: center" });
columns.Bound(p => p.Id).Width(60);
columns.Bound(p => p.Title).Width(250);
columns.Bound(p => p.AssignedUser).Width(120);
columns.Bound(p => p.Status);
columns.Bound(p => p.Priority);
columns.Bound(p => p.Category);
columns.Bound(p => p.Tier);
columns.Bound(p => p.LastModifiedAsString).Title("Last Modified").Width(120);
})
.ClientRowTemplate(
"<
tr
>" +
"<
td
>" +
"<
img
style
=
'margin-top:5px;'
src
=
'" + Url.Content("~/Images/") +"#:data.Icon#'
alt
=
'#:data.Icon#'
/>" +
"</
td
>" +
"<
td
width
=
'60'
>#: Id #</
td
>" +
"<
td
width
=
'250'
>#: Title #</
td
>" +
"<
td
width
=
'120'
>#: AssignedUser #</
td
>" +
"<
td
>#: Status #</
td
>" +
"<
td
>#: Priority #</
td
>" +
"<
td
>#: Category #</
td
>" +
"<
td
>#: Tier #</
td
>" +
"<
td
>#: LastModifiedAsString #</
td
>" +
"</
tr
>"
)
.Pageable()
.Sortable()
.Scrollable()
.Groupable()
.Filterable(filterable => filterable
.Extra(false)
.Operators(operators => operators
.ForString(str => str.Clear()
.StartsWith("Starts with")
.IsEqualTo("Is equal to")
.IsNotEqualTo("Is not equal to")
))
)
.Selectable(selectable => selectable
.Mode(GridSelectionMode.Single))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Get", "Grid"))
)
.Events(e => e.Change("onChanged"))
)
<
script
type
=
"text/javascript"
>
function onChanged(arg) {
var selected = this.select();
var wiId = this.dataItem(selected).Id;
window.location = '../WorkItem/Edit?Id=' + wiId;
}
var myGrid;
$(function () {
myGrid = $('#Grid').data('kendoGrid');
});
setInterval(DoWork, parseInt(@ViewBag.RefreshInterval));
function DoWork() {
myGrid.dataSource.read();
}
</
script
>
======================
Kendo ComboBox Event:
======================
transport: {
read: {
type: "POST",
dataType: "json",
data: function(e){
//alert(e.toSource());
var grid = $("#grid").data("kendoGrid");
var rowDataItem = grid.dataItem(grid.tbody.find("tr")); /* I need Current Row */
alert(rowDataItem.toSource());
},
url: "<?
php
echo $this->url( array('module'=> 'Invoice', 'controller' => 'backend', 'action' => 'gateway' ), 'adminrout', true); ?>"
}
}