kendo-ui

Kendo UI AutoComplete datasource transport reads only once

三世轮回 提交于 2019-11-29 12:16:41
问题 I'm becoming crazy with Kendo UI AutoComplete component. I'm using my own functions to access data with jQuery, so I have to set the AutoComplete dataSource.transport.read as a function. The code is something like this. minLengthAtocomplete = 3; $('#autocomplete').kendoAutoComplete({ minLength : 3, filter : "contains", dataValueField : "key", dataTextField : "value", dataSource : new kendo.data.DataSource({ transport : { read : _OnTransportRead }, schema : { /* object schema */ } }) });

How to bind Kendo Grid with System.Data.DataTable at runtime

妖精的绣舞 提交于 2019-11-29 11:53:37
I need to open a Kendo Grid in popup on Button Click. On button click server returns DataTable which has dynamics column (i.e. 1 to n no. of columns).On button click i get DataTable using jQuery ajax call. But I am unable to bind that data. How to resolve this issue Try like this, Script <script type="text/javascript"> $(function () { schmebind(); }); function schmebind() { var schemaModel = {}; var type; var IsEditable = false; var dateColumnArray = []; $.each(JaiminField, function (index, da) { type = (da.type == undefined || da.type == 'number' || da.type == 'date') ? 'string' : da.type;

Kendo grid image column

寵の児 提交于 2019-11-29 10:22:31
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='../../Images/pic.png' /> </text> ).Title("Image"); The images aren't shown, whether I define the image src

KendoUI: resetting grid data to first page after button click

我的梦境 提交于 2019-11-29 09:33:41
I have the following scenario: in my page I have a grid (with pagination) bounded to a datasource. When I click on the button "Extract" the grid gets populated (reading paginated data through a web service). Then i select "page 2" through grid pagination. Again the web service is invoked to return data. Now: I would like to click on "Extract" once more, to reload and show data on the first page. I'm not sure which is the best way. I would like to make just one call to the service (with input parameters) and have pagination index in the grid resetted. I am now using the following code: $("

Get record count in Kendo Grid after dataSource.read

泪湿孤枕 提交于 2019-11-29 09:13:21
I want to be able to push the record count from my Kendo grid after read (refresh). Here is my Kendo Grid: @(Html.Kendo().Grid(Model) .Name("SearchWindowGrid") .Columns(columns => { columns.Bound(p => p.SYSTEM_ITEMS_SEGMENT1).Hidden(); }) .ClientRowTemplate( "<tr>" + "<td>" + "<span><b>#: SYSTEM_ITEMS_SEGMENT1#</b></span> <br/>" + "<span>#: DESCRIPTION# </span>" + "</td>" + "</tr>" ) .DataSource(dataSource => dataSource .Ajax() .Read(read => read.Action("PopulateSearchWindow", "Item").Data("additionalSearchWindowInfo")) .Events(ev => ev.Error("onErrorSearchWindow")) ) .Selectable(s => s

KendoUI filter TreeView

杀马特。学长 韩版系。学妹 提交于 2019-11-29 07:54:10
问题 I am using the treeview of KendoUI and want to give the user the possibility to filter it. There is even a demo that does what I want (http://demos.kendoui.com/web/treeview/api.html) The Problem is that the filter is only applied to the 1st hierarchy of the TreeView, so if the filter-text is present in a child but not the parent, then the child won't be displayed. Example: Item 1 Item 2 Item xzy Item abc If the search text would be "abc", no item would be displayed. Instead I would like to

When editing a grid, how do I disable specific fields by row?

我只是一个虾纸丫 提交于 2019-11-29 07:50:57
I have a kendo grid with data in it and multiple columns (say col 1, 2, and 3). Columns 1, 2, 3 need to be able to be edited (or preventing editing) based off the values of each other. This is row specific. For instance, if column 1 (date) is < column 2 (date) then column 3 is not allowed to be edited. I know it's simple enough to disable or enable an entire column but my requirements are row specific. So row 1 could have column 3 enabled and row 2 could have column 3 disabled. Any thoughts? My suggestion is creating an editor function that validates the condition. This of course has the

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

…衆ロ難τιáo~ 提交于 2019-11-29 07:23:00
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. Found the answer. One other method of refreshing the datasource I read about was to do something like: vm.mainGridOptions.datasource.transport.read(); This

How to update Kendo Grid row from window

China☆狼群 提交于 2019-11-29 07:16:27
The set-up: ASP MVC project Kendo Grid in a view via Razor Column custom command, calls... JavaScript that opens Kendo window with refresh() URL to partial view as custom form The form has an input type=button calling JavaScript The barrier: How to update the row (dataItem?) of Grid with new model (from window/form javascript). I am unable to get a handle to target dataItem. Select() is not applicable here because the row is not selected. Instead, a custom button event opens modal Grid Window having the fields and commands for update, close, etc.. I could use the native Edit of Grid, but what

Kendo data grid - how to set column value from nested JSON object?

本小妞迷上赌 提交于 2019-11-29 07:03:39
I have JSON with structure like this: "id":1, "user_role":"ADMIN", "state":"ACTIVE", "address":{ "street":"test 59", "city":"City test", "post_number":"25050" }, How I should to pass values of address.street into column using setting in fields and model? Many thanks for any advice. If you want to show all values in a single column do what @RobinGiltner suggests. If you want to show each member of address in a different column you can do: var grid = $("#grid").kendoGrid({ dataSource: data, editable: true, columns : [ { field: "id", title: "#" }, { field: "user_role", title: "Role" }, { field: