kendo-ui

How to handle a Kendo UI Grid row double-click event

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 09:04:18
I have a selectable KendoUI grid in my MVC app. I want to do something when the user double-clicks on the grid. I don't see a double-click event for the grid. How may I handle the double-click event when there is none exposed? EfrainReyes Use the standard double click event. The first click will select the grid row, adding a .k-state-selected class to it, and the second click will trigger the double click event. $("#yourgridname").on("dblclick", "tr.k-state-selected", function () { // insert code here }); You can also use dataBound dataBound: function (e) { var grid = this; grid.tbody.find("tr

Get a reference to Kendo Grid from inside the error handler

眉间皱痕 提交于 2019-11-30 08:48:43
There already are questions how to get custom error handling, with answers , but all those answers use 'external' reference/selector to the grid to make it work, for example: function onError(e) { if (e.errors) { var message = "Error:\n"; var grid = $('#gridID').data('kendoGrid'); // <<- here (...) } Is it possible to get the reference to the grid from inside the error handling function without providing the selector by hand or 'externally' (because global variables are meh )? That way the error handling script could be totally self-contained. Patryk Ćwiek Version 'current' as of 2015-12-05

How to call refresh() on a kendo-grid from an Angular controller?

我只是一个虾纸丫 提交于 2019-11-30 08:37:38
问题 I'm attempting to follow several suggestions on refreshing a kendo-grid such as this. The essential is that in the html I have: <div kendo-grid="vm.webapiGrid" options="vm.mainGridOptions"> Then in the controller I have: vm.webapiGrid.refresh(); Note: I'm using the ControllerAs syntax so I am using "vm" rather than $scope. My problem is that "vm.webapiGrid" is undefined. This seems so straightforward, but I'm not sure why it is undefined. 回答1: Found the answer. One other method of refreshing

Kendo grid image column

我怕爱的太早我们不能终老 提交于 2019-11-30 08:31:33
问题 working on a MVC4 project, I'm trying to add a column to my kendo grid that displays an image. <div id="datagrid"> @(Html.Kendo().Grid<SustIMS.Models.ConcessionModel>() .Name("datagrid_Concessions") .Columns(columns => { columns.Bound(c => c.Code).Title(ViewBag.lblCode); columns.Bound(c => c.Description).Title(ViewBag.lblDescription); columns.Template(@<text> <img src='@item.Image' /> </text> ).Title("Image"); }) I've tried that but no luck. Also tried: columns.Template(@<text> <img src='../.

How to call javascript method from ClientTemplate in Kendo grid?

独自空忆成欢 提交于 2019-11-30 08:31:32
问题 Is it possible to put in the ClientTemplate of Kendo grid a javascript statement? I would like to calculate some data on the client and then to put the result in the row. I tried this: columns.Bound("ExecutionStartDateTime").Title("SummaryLine").Width("20%").ClientTemplate("<script> scheduleForm.generateSummary(#= ExecutionStartDateTime #, 2); </script>"); However, it gave no effect. 回答1: You can, with template literal syntax: <script> function someFuntion(date) { var result = ""; // Do

Set default filter for Kendo UI Grid

余生颓废 提交于 2019-11-30 08:27:06
问题 I have a Kendo UI grid that is rendered with javaScript. I want the string columns to have a single option ("Contains") and without the second filter. So far so good, I wrote $("#MyGrid").kendoGrid({ // other bits of configuration here filterable: { extra:false, operators: { string:{ contains: "Contains"} } }, // more bits of configuration here }); As part of the definition of the grid. And the result looks good-ish (I only have one option, so the drop down is redundant). However, regardless

Search All Columns in KendoUI Grid

浪尽此生 提交于 2019-11-30 08:18:23
I am trying to create a search box for a kendoUI grid. I have been able to get a start on doing a search based on one field however I would like the value in my search box to search all columns in the grid. function() { grid.data("kendoGrid").dataSource.filter({ field: "ProductName", operator: "contains", value: $('#category').val() }); } See js fiddle example I tried using the or logic operator here: jsfiddle.net however I can't seem to get it to work.... (see or logic button) I think that you should say eq to fee or eq to fi if you want to match one of the two conditions. I´ve slightly

How to change page size dynamically in Kendo UI Grid

北城以北 提交于 2019-11-30 08:15:00
I am having a Kendo UI grid showing more than 1000 data. I also have a dropdown list for different page size - 15, 25, 50, 100. On selection of a page size, how can we change the page size of Kendo UI grid? Daniel You can set the page size in the combobox change event. (Also see JSBin example .) $("#comboBox").kendoComboBox({ dataTextField: "text", dataValueField: "value", dataSource: [ { text: 1 }, { text: 2 }, { text: 3 }, { text: 4 }, { text: 5 } ], change: function(e) { var grid = $("#grid").data("kendoGrid"); grid.dataSource.pageSize(parseInt(this.value())); // this.value() being the

How to change Kendo UI grid page index programmatically?

别来无恙 提交于 2019-11-30 08:08:26
I have a kendo ui grid. Let's say that the JS variable pointing to the grid is called grid . How can I go to page 3 programmatically? Thanks. OnaBai You might to use: grid.dataSource.query({ page: 3, pageSize: 20 }); Documentation in here . or: grid.dataSource.page(3); Documentation in here Answer is just set it pate: 1 when datasource created var dataSource = new kendo.data.DataSource({ data: [ { name: "Tea", category: "Beverages" }, { name: "Coffee", category: "Beverages" }, { name: "Ham", category: "Food" } ], page: 1, // a page of data contains two data items pageSize: 2 }); 来源: https:/

Kendo + Angular chart data

岁酱吖の 提交于 2019-11-30 07:33:21
I'm trying out Kendo charts with angular, and I have problem displaying data, here is my code: HTML: <div kendo-chart="rchart" data-k-options="chartOptions" data-role="chart" class="k-chart" style="position: relative;"></div> Javascript: resultService.getResult().then(function (resultResponse) { $scope.data = resultResponse.data; $scope.oldReps = _.pluck($scope.data.TreningScores.Item1, 'Item2'); $scope.newReps = _.pluck($scope.data.TreningScores.Item2, 'Item2'); $scope.categories = _.pluck($scope.data.TreningScores.Item1, 'Item1'); }); $scope.chartOptions = { legend: { position: "bottom" },