kendo-ui

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 Get Dropdown's Selected Item's text in Kendo UI?

 ̄綄美尐妖づ 提交于 2019-12-03 10:37:31
问题 I am using Kendo UI Controls. I want to get the selected text of the dropdown list in jquery. I have used this syntax : $("#ddl").data("kendoDropDownList").text(); I am able to get the text in all browsers except IE. I don't know why this is not working in IE, please help me. Is there any other way to get selected Text ? 回答1: In order to get text value of a DropDownList use command as below : $("#ddl").data("kendoDropDownList").text(); 回答2: For DropDownLists, you include a DisplayText and a

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 query a local websql DB with Kendo UI

喜欢而已 提交于 2019-12-03 09:30:00
问题 Forgive me if this question is too broad for SO but I'm struggling to find any examples of what I need and thought someone may be able to point me in the right direction. I'm just starting out with Kendo UI mobile and am trying to find a tutorial or any example code for creating/querying a local client side websql database within kendo ui mobile. There is nothing in the docs... Can anyone help? Thanks in advance 回答1: You can create a custom transport for the Kendo DataSource. For example in

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

Creating a basic data grid with Kendo UI and AngularJS

╄→尐↘猪︶ㄣ 提交于 2019-12-03 07:56:18
问题 I'm experimenting with AngularJS. I want to show a basic Kendo Grid. I'm trying to do this using pure directives. With that in mind, I've looked at the Kendo UI / Angular JS project (https://github.com/kendo-labs/angular-kendo). Unfortunately, my index.html: <div>Products: {{products.length}}</div> <div kendo-grid k-data-source="products" k-selectable="'row'" k-pageable='{ "refresh": true, "pageSizes": true }' k-columns='[ { "field": "Name", "title": "Name"}, { "field": "Department", "title":

How to populate Kendo grid with an angular $http GET call

徘徊边缘 提交于 2019-12-03 07:56:06
问题 I'm having trouble binding a Kendo grid to an angular service call. I have an angular $http service that has a getData() method which looks like this: 'use-strict'; payrollApp.factory('dataService', function ($http, $q) { return { getData: function () { var deferred = $q.defer(); $http({ method: 'GET', url: '/api/apihome/', }).success(function (data, status, headers, config) { deferred.resolve(data); }).error(function (data, status, headers, config) { deferred.reject(status); }); return

Kendo DatePicker fails validation for custom date format

时光毁灭记忆、已成空白 提交于 2019-12-03 06:51:26
问题 I'm using Kendo DatePicker to edit a Date field being displayed in a Kendo Grid in my ASP.NET MVC 4 project. In order to have the DatePicker being used for the Date field use custom date format string, I updated the Date.cshtml file under the EditorTemplates folder to the following: @(Html.Kendo().DatePickerFor(m => m).Format("dd/MM/yyyy")) By doing that, I managed to have the DatePicker display the format as I want it to. However, it failed validation for some of the dates entered for input,

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