kendo-grid

how to check whether a div is focused or not in jquery?

谁说胖子不能爱 提交于 2019-12-11 03:04:51
问题 I'm trying to use kendo grid in my view, I want to create new row in the grid after pressing enter key. I can do this by writing following code: <div id="GridContainer"> <div id="grid"></div> </div> $(document.body).keypress(function (e) { if (e.keyCode == 13) { var grid = $("#grid").data("kendoGrid"); grid.addRow(); } }); The problem is, on the page, whenever I press enter, its creating new row. But I want that only when the grid is focused. How can I do that? I tried to apply focus to the

Kendo MVC grid with editable enum column

≯℡__Kan透↙ 提交于 2019-12-11 02:45:20
问题 I have a simple model that I need to display and edit in Kendo's MVC Grid component. public class MyModel { public int Id {get; set;} public string SomeProperty {get; set;} public MyEnum MyEnum {get; set;} } public enum MyEnum { FirstItem = 1, SecondItem = 2, ThirdItem = 3 } And I have my grid set up like this: @(Html.Kendo() .Grid<MyModel>() .Name("grid").Columns(columns => { columns.Bound(o => o.SomeProperty).Width(200); columns.Bound(o => o.MyEnum).Width(200); columns.Command(command => {

Unable to style borders of a row of Kendo grid

我只是一个虾纸丫 提交于 2019-12-11 02:45:04
问题 I'm attempting to style an MVC kendo grid based on values in the underlying datasource. I have a mechanism that seems to work, but certain style elements (notably borders) do not seem to accept the new style class, whereas other elements (row background color) work fine. Grid: @(Html.Kendo().Grid(Of RTFVM)().Name("RealTimeFinancials") _ .Events(Function(x) x.DataBound("LineItems_Databound")) _ .Columns(Sub(c) c.Bound(Function(x) x.Line.LineItem).HtmlAttributes(New With {.style = "text-align

Excel export of Telerik Kendo Grid with multiple detail levels

╄→尐↘猪︶ㄣ 提交于 2019-12-11 02:17:48
问题 I have a Kendo Grid with "multiple hierarchy" - two detail levels, like this: Main row Details Details of details Some more details of details Details Details of details Main row Details Detail of details Using this example I am able to export the "Main row" along with the "Details" row. But I am having a hard time exporting the "Details of details" row. I know it is possible using the approach in the example, but cannot seem to shuffle the code "the right way". Has anyone done this before,

Kendo grid duplicate records inserted

前提是你 提交于 2019-12-11 01:57:44
问题 I have a kendo grid in inline editing mode. When I press "Add new item" button, new row is added and set to the edit mode. By pressing the "Update" button multiple time, I'm able to insert duplicate records into database. Is there a possibility to disable Update button after the first click? Also row selection on kendo grid is lost after insert is performed. Is that normal behavior? 回答1: This would happen if you don't return the ID of the newly inserted records. The Kendo DataSource would

Disable/remove close icon on Kendo Grid's default group column

我只是一个虾纸丫 提交于 2019-12-11 01:45:25
问题 I am using Kendo UI Grid for one of my solutions. I have this one task/requirement where I should be able to give a default grouping for the grid, and the user should not be able to remove this grouping from the UI. There is one way of achieving this as in this jsFiddle example: http://jsfiddle.net/siva_hari/xzLfgsba/4/ If you look at the following example, the grouping is true but the grouping can be changed by clicking on k-group-delete icon or by dragging the grouped column back into the

Selecting a row from a Kendo Grid programmatically

寵の児 提交于 2019-12-11 01:34:27
问题 I have got a grid and one of its columns is a template with a checkbox in it: .Name("grid") .Columns(columns => { columns.Bound(c => c.Id).ClientTemplate("<input type=\"checkbox\" id=\"chk_#=Id#\" class=\"gridCK\" onclick=\"zzz(this)\"/>"); When I check the checkbox, I want its row to become selected (and vice-versa). I have tried the following: function zzz(e) { var id = e.id; var grid = $("#grid").data("kendoGrid"); var data = grid.dataSource.data(); var res = $.grep(data, function (d) { if

How to access column name dynamically in Kendo Grid template

不羁岁月 提交于 2019-12-11 01:32:46
问题 I need to access the column name dynamically in Kendo Grid template. Code: $("#grid").kendoGrid({ dataSource: [ { Quantity: 2 , Amount: 650}, { Quantity: 0, Amount: 0 }, { Quantity: 1, Amount: 500 }, { Quantity: 4, Amount: 1047 } ], sortable: true, columns: [ { field: "Quantity", template: function (dataItem) { if (dataItem.Quantity == '0') { return "--"; } else { return dataItem.Quantity; } } }, { field: "Amount", template: function (dataItem) { if (dataItem.Amount == '0') { return "--"; }

checkbox event is not firing with jquery

不羁岁月 提交于 2019-12-11 01:08:41
问题 I have got checkbox row in parent grid and checkbox row in child grid as well in Hierarchy grid mode using kendo UI. the architecture is like this... I have got four rows in parent grid,in that one column is checkbox and for every parent row i have got one child grid with 4 rows in it and one checkbox column as well... If i click the checkbox in parent grid row i need to access the checkboxes in child grid column related to this row only and need to set the checked attribute as true for that

How to filter whole datasource on a kendo grid with virtualized remote data

会有一股神秘感。 提交于 2019-12-11 00:59:09
问题 At work, we are having performances issues with a kendo grid that has a lot of row. We are thinking about using virtualization of remote data as a solution like you can see on the link below. https://demos.telerik.com/kendo-ui/grid/virtualization-remote-data The problem we have with that solution is that we allow filters on a lots of our columns and only the rows that are defined in the pagesize of the grid are displayed. In the link below, you can easily see what I mean by that. I added the