kendo-grid

How to change the value of a kendo bound html input

独自空忆成欢 提交于 2019-11-28 07:22:43
问题 I have a kendoui grid with a custom popup for editing. In this popup I have an input which is bound to a value of the grid: <input type="text" class="k-input k-textbox" id="test" data-bind="value:SearchFilter"> This works fine. Click edit in the grid, change the value in the textbox and the value propagates to the grid. But now I want to change the value of the textbox in javascript.. So I now have this: $('#test').val("testvalue"); This indeed changes the value of the textbox, but upon save

Kendo UI Grid Conditional editing

 ̄綄美尐妖づ 提交于 2019-11-28 06:44:44
问题 I would like to disable DiscountPercentageMRC/NRC/Usage columns for certain CatalogProductId's. Please find below javascript for the grid. Any help would be greatly appreciated. <h2>Kendo Grid bound to ASP.NET MVC action methods</h2> @* The DIV where the Kendo grid will be initialized *@ <div id="grid"></div> <script> $(document).ready(function () { $("#grid").kendoGrid({ columns: [ { field: "CompanyId"}, { field: "CompanyName" }, { field: "DiscountPercentageMRC" }, { field: "CatalogProductId

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

谁都会走 提交于 2019-11-28 05:08:40
问题 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 回答1: Try like this, Script <script type="text/javascript"> $(function () { schmebind(); }); function schmebind() { var schemaModel = {}; var type; var IsEditable = false; var dateColumnArray = []; $.each(JaiminField, function

Adding bindeable checkbox column to grid

醉酒当歌 提交于 2019-11-28 04:44:15
Have this column in a Kendo grid that currently display a MySQL Boolean value so we have either 1 or 0. Made this demo to play on... This in an autosync and inline:true grid. I would like this column to be of type "Checkbox" but, for some weird reasons, i just cannot find a demo or an example on the web that displays "enabled" checkbox that changes 1 to 0 when unchecked and Vice-Versa. There are some previous considerations: When you click in a cell for editing you are switching it to edit mode and then is when editor function get executed. If you are not in edition mode despite of the HTML

Kendo grid date column not formatting

≯℡__Kan透↙ 提交于 2019-11-28 04:03:23
I have a KendoGrid like below and when I run the application, I'm not getting the expected format for date column. $("#empGrid").kendoGrid({ dataSource: { data: empModel.Value, pageSize: 10 }, columns: [ { field: "Name", width: 90, title: "Name" }, { field: "DOJ", width: 90, title: "DOJ", type: "date", format:"{0:MM-dd-yyyy}" } ] }); When I run this, I'm getting " 2013-07-02T00:00:00Z " in DOJ column. Why it is not formatting? Any idea? I found this piece of information and got it to work correctly. The data given to me was in string format so I needed to parse the string using kendo.parseDate

KendoUI: resetting grid data to first page after button click

江枫思渺然 提交于 2019-11-28 03:09:12
问题 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

Get record count in Kendo Grid after dataSource.read

半世苍凉 提交于 2019-11-28 02:38:09
问题 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(

Kendo-UI grid Set Value in grid with Javascript

◇◆丶佛笑我妖孽 提交于 2019-11-27 21:10:09
问题 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

How to change columns set of kendo grid dynamically

筅森魡賤 提交于 2019-11-27 18:12:29
I am trying to change the columns collection of my Kendo grid in the below way. var grid = $("#grid").data("kendoGrid"); $http.get('/api/GetGridColumns') .success(function (data) { grid.columns = data; }) .error(function (data) { console.log(data); }); This is changing the column collection but not reflecting immediately in my grid. But when I try to perform some actions in the grid (like grouping), then my new column set is appearing. Please let me know how can I achieve this. Regards, Dilip Kumar Edu Cielo You can do it by setting the KendoUI datasource, destroy the grid, and rebuild it $("

Kendo ui grid if else condition

北慕城南 提交于 2019-11-27 16:34:33
问题 What is wrong with my code? I have to check in kendo UI grid is there "OrderType 20" in my column. If it is, I need to apply my css condition which includes background, but it does not work, can someone help me? thanks template: '# if (OrderType == "OrderType 20") {#<div class='customClass'>#:OrderType#</div>#} else {#OrderType#}#' 回答1: It might help you for nested if else for kendo ui grid row template. i.e. template: "#if(ErrorDesc==null){# #: DeviceLabel # #}else If(ErrorDesc==""){# #: