kendo-grid

How to add row number to kendo ui grid?

我与影子孤独终老i 提交于 2019-11-27 15:05:31
问题 I have a kendo ui grid in my page that has some columns. Now I want to add a column to it that shows me row number. How to I do this? Thanks. 回答1: Initialize a variable and show it in column as template: "#= ++record #" Working Demo Here is code: var record = 0; $("#grid").kendoGrid({ dataSource: { data: [{ foo: "foo" },{ foo: "foo" },{ foo: "foo" },{ foo: "foo" },{ foo: "foo" },{ foo: "foo" },{ foo: "foo" },{ foo: "foo" },{ foo: "foo" },{ foo: "foo" },{ foo: "foo" },{ foo: "foo" },{ foo:

How to have an autocomplete field inside kendoUI grid using asp.net mvc wrapper

半城伤御伤魂 提交于 2019-11-27 07:27:40
问题 I want to create an autocomplete field inside my kendoUI grid. but I can't find any propper way on net. This is my view : @(Html.Kendo().Grid<SamuraiListing.Data.Company>() // Grid Name .Name("CompanyGrid") // Declare grid column .Columns(columns => { // Cretae all the columns base on Model columns.Bound(r => r.Name); columns.Bound(r => r.Telephone); columns.Bound(r => r.Email); columns.Bound(r => r.GPS); // Edit and Delete button column columns.Command(command => { command.Edit(); command

Kendo grid date column not formatting

只谈情不闲聊 提交于 2019-11-27 05:15:59
问题 I have a KendoGrid like below and when I run the application, I'm not getting the expected format for date column. $("#empGrid").kendoGrid({ dataSource: { data: empModel.Value, pageSize: 10 }, columns: [ { field: "Name", width: 90, title: "Name" }, { field: "DOJ", width: 90, title: "DOJ", type: "date", format:"{0:MM-dd-yyyy}" } ] }); When I run this, I'm getting " 2013-07-02T00:00:00Z " in DOJ column. Why it is not formatting? Any idea? 回答1: I found this piece of information and got it to

Uncaught TypeError : cannot read property 'replace' of undefined In Grid

末鹿安然 提交于 2019-11-27 03:51:40
问题 I'm new in using Kendo Grid and Kendo UI . My question is how can i resolve this Error Uncaught TypeError: Cannot read property 'replace' of undefined This is my Code on my KendoGrid $("#Grid").kendoGrid({ scrollable: false, sortable: true, pageable: { refresh: true, pageSizes: true }, dataSource: { transport: { read: { url: '/Info/InfoList?search=' + search, dataType: "json", type: "POST" } }, pageSize: 10 }, rowTemplate: kendo.template($("#rowTemplate").html().replace('k-alt', '')),

How to define a Kendo grid Column filter between two dates?

[亡魂溺海] 提交于 2019-11-27 02:27:36
问题 In our application we want the filter on a date column to prompt the user for a start date and an end date, with the filter returning rows where the field in question falls between (or on) those two dates. Initial Approach Our initial approach was to restrict date types to use gte and lte operators, and add the "extra : true" filterable option on the column. This came close, but presented the following problems: A) Each date input could use either the gte (Start) or lte (End) operator,

Kendo UI Grid multi level hierarchy (n-levels of hierarchy)

大憨熊 提交于 2019-11-27 02:11:48
I am using the Kendo UI Grid and currently display parent child records appropriately. However, it turns out that i will actually need to display n-levels vs. strictly parent-child. Not every record will have children, but some will have multiple levels. Current grid code: var jgrid = $("#boxesgrid").kendoGrid({ columns: [ { field: "JobId", hidden: true }, { field: "PercentComplete", hidden: true }, { field: "JobStatusId", hidden: true }, { field: "AppName", title: "App", template: "<span>${AppName}</span><img class='health-img-r' id=app-${JobId} title='health' src='' alt='health_png' />",

How can I use nested Json to populate Kendo UI grid?

主宰稳场 提交于 2019-11-26 21:03:58
问题 How can I populate Kendo UI grid with nested JSON. I mean my JSON is like var myJson: [{"oneType":[ {"id":1,"name":"John Doe"}, {"id":2,"name":"Don Joeh"} ]}, {"othertype":"working"}, {"otherstuff":"xyz"}] }]; and I want Kendo UI Grid with columns as Id, Name, OtherType and OtherStuff. Thanks in advance.! 回答1: For complex JSON structures, you might use schema.parse var grid = $("#grid").kendoGrid({ dataSource : { data : [ { "oneType": [ {"id": 1, "name": "John Doe"}, {"id": 2, "name": "Don

How to change columns set of kendo grid dynamically

筅森魡賤 提交于 2019-11-26 19:20:44
问题 I am trying to change the columns collection of my Kendo grid in the below way. var grid = $("#grid").data("kendoGrid"); $http.get('/api/GetGridColumns') .success(function (data) { grid.columns = data; }) .error(function (data) { console.log(data); }); This is changing the column collection but not reflecting immediately in my grid. But when I try to perform some actions in the grid (like grouping), then my new column set is appearing. Please let me know how can I achieve this. Regards, Dilip

Reloading/refreshing Kendo Grid

帅比萌擦擦* 提交于 2019-11-26 18:23:26
How to reload or refresh a Kendo Grid using Javascript? It is often required to reload or refresh a grid after sometime or after a user action. Jaimin You can use $('#GridName').data('kendoGrid').dataSource.read(); <!-- first reload data source --> $('#GridName').data('kendoGrid').refresh(); <!-- refresh current UI --> Purna Pilla I never do refresh . $('#GridName').data('kendoGrid').dataSource.read(); alone works for me all the time. Oxon $('#GridName').data('kendoGrid').dataSource.read(); $('#GridName').data('kendoGrid').refresh(); In a recent project, I had to update the Kendo UI Grid based

Kendo UI Grid multi level hierarchy (n-levels of hierarchy)

喜夏-厌秋 提交于 2019-11-26 09:59:42
问题 I am using the Kendo UI Grid and currently display parent child records appropriately. However, it turns out that i will actually need to display n-levels vs. strictly parent-child. Not every record will have children, but some will have multiple levels. Current grid code: var jgrid = $(\"#boxesgrid\").kendoGrid({ columns: [ { field: \"JobId\", hidden: true }, { field: \"PercentComplete\", hidden: true }, { field: \"JobStatusId\", hidden: true }, { field: \"AppName\", title: \"App\", template