kendo-grid

Kendo UI Grid: Select single cell, get back DataItem, and prevent specific cells from being selected?

a 夏天 提交于 2019-12-03 16:16:11
I've got a Kendo UI Grid displaying a set of data and I need to be able to select specific cells (cells in specific columns), and when selected, return the DataItem for the row the selected cell is in, and the property of that DataItem that was clicked on. I don't know if this is possible, but I've been working on it all day and have concluded that I need some help. Here's my grid and dataBound function, which currently gets me the DataItem, but that's it: var hhGrid = hhDiv.kendoGrid({ dataSource: housing, scrollable: false, sortable: true, selectable: 'cell', columns: [ { field: "Start",

Kendo Grid cancel edit event

可紊 提交于 2019-12-03 15:33:41
问题 I'm using the edit event on a Kendo grid to show a couple of hidden columns. I'll then hide them again on the save event. Problem I have is that there doesn't appear to be an event for cancelling edit mode, so the column get screwed up if the user clicks cancel. Is there an undocumented event for cancel or do I need to find a workaround? 回答1: Basically there is no such "Cancel" event, however you can attach click event on the "Cancel" button in the еdit event of the Grid. Please check the

Kendo Grid: Canceling edit deletes new row

本秂侑毒 提交于 2019-12-03 14:20:21
Here is a demo to for the behavior I am experiencing. If you edit the existing row with id 1, change the text to something else and then press the cancel button, the row is reverted correctly to its previous state. In order to reproduce my problem you need to: Add a new row Press the update button to save it. Select the row again and press the update button. Press the cancel button The row disappears! Even though there are similar questions on this problem, I have yet to find a satisfactory answer. Some people say that I need to define an id. As you can see from my demo, this does not make any

KendoUI Grid Decimal number column

折月煮酒 提交于 2019-12-03 11:17:09
问题 I have a column for weight (in Kg). When the user clicks on it I need to enable them to be able to put in decimal number with 3 places. The problem I have is at the moment it only allows them to put it in to 2 places, but shows as 3 places. You can type in a number to many decimal places but when it saves it will round it to 2 places. My column is set up like so: ... { field: "weight", title: "Weight", width: 40, format: "n4", decimals: 4, step: 0.001, template: "#= weight.toFixed(3)+'kg' #"

How can I refresh a grid data source using angular Kendo UI

心已入冬 提交于 2019-12-03 11:12:52
问题 I am combining Telerik Kendo grid with Angular using the Angular Kendo UI project. I have the following markup: <div kendo-grid="" k-options="thingsOptions" style="height: 600px;" /> and the following code in my controller: $scope.thingsOptions = { dataSource: { type: "json", transport: { read: "/OM/om/getAssets", dataType: "json" }, schema: { model: { id: "ProductID", ... This all works fine however I would like to force a data source refresh of my grid from my controller. something like

Conditional in Kendo grid column template

不羁岁月 提交于 2019-12-03 10:53:12
I need to apply a condition in my kendo grid column template. Here is my code: columns: [ { field: "EmpName", title: "Name", template: '<a href="\\#" onclick="showName();">#= if (empName == null){ "show xxx" } else { // I want to show actual name if it is not null empName } #</a>' }, Check this '<a href="" onclick="showName();">'# if( empName==null) {#<span>show xxx<span># } else {#<span>#: empName#<span>#} #'</a>' something like this should work for you: # if(test == null) { # <span style="border:1px solid red"></span> # } else { # <span style="border:1px solid lime"></span> # } # Don´t know

How to refresh the Kendo UI grid

家住魔仙堡 提交于 2019-12-03 10:29:17
I am trying to refresh a Kendo UI grid but have not yet been successful. Would anybody please advise what I missed or what I did wrong? I have the following code: .cshtml: $('#btnRefresh').click(function (e){ $.ajax({ type: 'POST', url: "@(Url.Content("~/Administration/RefreshAll/"))", success: function () { $("#Product").data("kendoGrid").dataSource.read(); $('#Product').data('kendoGrid').refresh(); //grid.refresh(); location.reload(true); }, error: function (){ $("#btnRefresh").removeAttr('disabled'); } }); }); Controller: public ActionResult RefreshAll([DataSourceRequest] DataSourceRequest

How to access Kendo Grid's column menu only from outside the grid and add the filter option for specific columns in the column header

自作多情 提交于 2019-12-03 08:39:50
I am new to Kendo Grid and trying to use the columnMenu option. I need to access the column Menu function (only the ability to show/hide columns from a button outside the grid. This link allows me to do that and it is working fine. How to show Kendo Grid's columnMenu using script But this still retains the columnMenu option in the column headers which I do not need. So after looking into it further, I was able to remove the column headers on the load using defaultGrid.thead.find("[data-field=Address]>.k-header-column-menu").remove(); where Address is one of the columns in the grid. I still do

I want to display the applied filter criteria on the Kendo UI Grid

て烟熏妆下的殇ゞ 提交于 2019-12-03 08:24:01
How can I display any applied filter criteria on the Kendo UI Grid. I would like to have a readonly display, of the applied criteria. Current functionality does allow user to apply filter, but that the user has to go to the filter menu to look for the filter details. Lars Höppner The Kendo UI data source doesn't have a filter event, so you'd need to implement that yourself. Then when the event is triggered, you can get the current filter and format it in whatever way you want it displayed. For example: var grid = $("#grid").kendoGrid(...); // override the original filter method in the grid's

KendoUI Grid Ajax Binding Parameters For Select

对着背影说爱祢 提交于 2019-12-03 06:25:00
I have a basic KendoUI Grid for my ASP.NET MVC app which uses ajax binding for the read. I'd like to enhance this so that a Form above the grid is used to help select data that should be displayed in the grid. This is a standard search form with basic fields like First Name, Last Name, Date of Birth, Customer Source, etc. with a search button. When the search button is pressed, I want to force the grid to go get the data that meets the criteria from the controller by passing in the Search Model with the fields I referenced above. The search form is contained within the _CustomerSearch partial