or
function onEdit_HireBookingInvoiceDetail(e) {$.ajax({ url: "@Url.Action("GetHireJobList", "Hire")", data: {HireJobId: e.dataItem['HIRE_JOB_ID'] != null ? e.dataItem['HIRE_JOB_ID'] : 0}, dataType: "json", type: "POST", success: function (myData){ $(e.form).find("#HireJob").data("tDropDownList").dataBind(myData); $(e.form).find('#HireJob').data('tDropDownList').select(function (dataItem) { return dataItem.Value == e.dataItem['HIRE_JOB_ID']; }); } }); }
@(Html.Kendo().DropDownList().Name("isPublic") .Items(items => { items.Add().Text("").Value(""); items.Add().Text("Yes").Value("true"); items.Add().Text("No").Value("false"); } ) )function onColumnReorderLeft(e) { if (e.oldIndex == 2 || e.newIndex == 2) { e.preventDefault(); return false; }}@(Html.Kendo().Grid(Model.DataLeftSide) .Name("VesselsInPortLeft") .DataSource(dataSource => dataSource.Server() .PageSize(200) .Model(model => model.Id(d => d.veid)) ) .CellAction(cell => { if (cell.Column.Title.Equals("")) { cell.HtmlAttributes["style"] = "background-color: lightgray"; } else if (cell.Column.Title.Equals("Name")) { cell.HtmlAttributes["style"] = String.Format("background-color: {0}; color: {1}", String.Format("#{0}", cell.DataItem.vesselnamebackcolor.Substring(2)), String.Format("#{0}", cell.DataItem.vesselnameforecolor.Substring(2))); } else if (cell.Column.Title.Equals("LOC")) { cell.HtmlAttributes["style"] = String.Format("background-color: {0}; color: {1}", String.Format("#{0}", cell.DataItem.currentberthbackcolor.Substring(2)), String.Format("#{0}", cell.DataItem.currentberthforecolor.Substring(2))); cell.HtmlAttributes["title"] = cell.DataItem.currentberthdesc; } else if (cell.Column.Title.Equals("Activity")) { cell.HtmlAttributes["style"] = String.Format("background-color: {0}; color: {1}", String.Format("#{0}", cell.DataItem.currentactivitybackcolor.Substring(2)), String.Format("#{0}", cell.DataItem.currentactivityforecolor.Substring(2))); cell.HtmlAttributes["title"] = cell.DataItem.currentactivitydesc; } else if (cell.Column.Title.Equals("Flag")) { cell.HtmlAttributes["title"] = cell.DataItem.FlagName; } } ) .Columns(columns => { columns.Bound(d => d.veid).Hidden().IncludeInMenu(false); columns.Bound(d => d.vesselidused).Hidden().IncludeInMenu(false); //columns.Bound(d => d.Selected).Title("").Width(25).IncludeInMenu(false).Sortable(false); columns.Template(@<text></text>).Title("").Width(25).IncludeInMenu(false); columns.Bound(d => d.vesselname).Title("Name"); columns.Bound(d => d.flagshortname).Title("Flag").Width(60); columns.Bound(d => d.currentberthabbr).Title("LOC").Width(60); columns.Bound(d => d.currentactivityabbr).Title("Activity").Width(80); columns.Bound(d => d.agentname).Title("Agent"); }) .Sortable(sortable => sortable .AllowUnsort(true) .SortMode(GridSortMode.MultipleColumn)) .Scrollable(scr=>scr.Height(680)) //scr=>scr.Height(452) scr=>scr.Height("100%") .Filterable() .ColumnMenu() .Resizable(resize => resize.Columns(true)) .Reorderable(reorder => reorder.Columns(true)) .Selectable(selectable => selectable.Mode(GridSelectionMode.Single)) .Events(events => events.Change("onChangeLeft").ColumnResize("onColumnResizeLeft").ColumnReorder("onColumnReorderLeft")) )