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")) )Hi!
I've a inline editable Kendo Grid configured with a create button in the toolbar, paging is activated, the data are sorted and the datasource is an ajax datasource. This configuration generates multipe problems and I need a fix or a workaround for this, because I can't disable the sorting.
If I'm not on page 1 in the grid and I press the create button nothing happens. I can press the button multiple times and nothing happens. If I go back to the first page I have one empty data line for every pressed button in the grid. And it's not a javascript error.
Maybe it's possible to switch the page during pressing the create button but how?
If I've a sorting with no results in the grid and press the create button nothing happens too. After I clear the sorting I have one empty data entry for every pressed create button in the grid too.
I understand the technical reason and know about the workaround, but not the normal user. :-)
How I can handle the multipe button press?
Thank you for help!