kendo-ui

Set default filter for Kendo UI Grid

别来无恙 提交于 2019-11-29 06:44:30
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 of this, the filter still performs the equals operation rather than the contains operation (which is

Kendo MVVM and binding or extending custom events

对着背影说爱祢 提交于 2019-11-29 04:36:06
I have a ComboBox in my page and I want to bind keypress event to my Kendo ComboBox when the cliend writes down any letter. As I understand kendo doesn't have any keypress event on ComboBox. I've found that kendo has something like this to bind values and functions: kendo.data.binders.slide = kendo.data.Binder.extend({ refresh: function () { var value = this.bindings["slide"].get(); if (value) { $(this.element).slideDown(); } else { $(this.element).slideUp(); } } }); Source: Click Here But the problem is I can't workaround that and make it to trigger keypress event on the InputBox in the

Kendo: Handling Errors in Ajax Data Requests

萝らか妹 提交于 2019-11-29 02:51:32
Using Kendo UI in MVC4 I have a Grid that makes Ajax calls for data back into the Controller: public ActionResult SearchUser_Read([DataSourceRequest]DataSourceRequest request) { var data = CreateAnExcaptionHere(); return Json(data.ToDataSourceResult(request)); } How do I use this call to inform the page that there was an error? If you need to display an error message from the server then you can do it by returning a DataSourceResult object with only its Errors property set: return this.Json(new DataSourceResult { Errors = "my custom error" }); And pick it up on the client by using this

Submit form with Kendo MVC Grid and other elements

不想你离开。 提交于 2019-11-29 02:31:57
问题 I am trying to get a form containing a Kendo MVC grid and other elements to submit. The View model contains contains three string fields and an IEnumerable collection. The grid is server bound. I am not adding any elements or deleting any elements from the list using the grid but the grid contains a check box mapped to a boolean column in the list items. Whenever I submit this form the three string elements return in the post method but the list is always null. Here is the data model: public

Kendo UI Datepicker disable typing

和自甴很熟 提交于 2019-11-29 01:42:24
问题 I want users to be able to change a Kendo UI Datepicker value only through its button and selecting the date from the pop-up. How can I prevent users from typing in the Datepicker textbox? Can I disable the textbox without disabling the whole control? 回答1: On your input element add this attribute and value... onkeydown="return false;" This will disable typed input and still allow using the calendar control input. 回答2: Use the control as below- @(Html.Kendo().DatePicker() .Name("FromDate")

How to get the displayed data of KendoGrid in json format?

╄→гoц情女王★ 提交于 2019-11-28 23:56:00
问题 I have a kendoGrid and i would like to get the JSON out of it after filtering and sorting how do I achieve this? something like the following, var grid = $("#grid").data("kendoGrid"); alert(grid.dataSource.data.json); // I could dig through grid.dataSource.data and I see a function ( .json doen't exist I put it there so you know what i want to achieve ) Thanks any help is greatly appreciated! 回答1: I think you're looking for var displayedData = $("#YourGrid").data().kendoGrid.dataSource.view()

How to add row number to kendo ui grid?

天涯浪子 提交于 2019-11-28 23:37:19
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. 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: "foo" },{ foo: "foo" },{ foo: "foo" },{ foo: "foo" },{ foo: "foo" },{ foo: "foo" },{ foo: "foo" },{ foo: "foo"

Tabstrip containing bootstrap columns

馋奶兔 提交于 2019-11-28 23:32:46
I have a Kendo tabstrip and I'm trying to put two divs with the col-md-6 class side by side inside a tabstrip item. Instead of having 2 columns, they stack on top of each other. If I change any of them to col-md-5 or smaller, they work correctly. Has anyone had this problem and found the culprit? This might be more of a 'hack' than a fix, but this is how we got around it create a class, lets call it boxFix .boxFix *, .boxFix *::before, .boxFix *::after { -moz-box-sizing: border-box !important; -webkit-box-sizing: border-box !important; box-sizing: border-box !important; } Then for the kendo

Kendo-UI grid Set Value in grid with Javascript

杀马特。学长 韩版系。学妹 提交于 2019-11-28 23:08:58
I'm just wondering how you go about changing a value of a row in a grid in JavaScript so that it is marked as 'dirty' in the grid and the underlying datasource. e.g. I have a list of Contact/Customer. They have 3 fields FirstName/LastName/IsPrimaryContact. There can only be 1 primary contact, so when the primary contact is set to true on a record I have JavaScript code that loops through the datasource and sets any other contacts set as primary to false. The JavaScript all fires fine and the data fields are set correctly but there are two problems: 1. The grid is not updated with the changes I

Setting Kendo UI grid height 100% of wrapper

只愿长相守 提交于 2019-11-28 19:42:07
I know there is an easy way to set fixed height of a Kendo UI grid through their API but for our specific needs, I need to make the grid expand in full height of its wrapper. With the following markup structure, I set .wrapper to height:600px and I tried to give .k-grid-content height:100% but it doesn't expand. #grid expands to 100% with height:100% but I need the inside contents to expand as well. How do I achieve that? Here is the demo JS BIN <div class="wrapper"> <div id="grid"> <div class="k-grid-header"></div> <div class="k-grid-content"></div> <div class="k-grid-pager"></div> </div> <