kendo-grid

Javascript - How to add objects to column array in kendo ui grid dynamically?

半世苍凉 提交于 2019-11-29 17:04:13
I am trying to generate objects in the columns array as the heading implies, although I haven't found a working method. alert( "Value 1: " + temporaryArray[1] + " - " + finalArray[1].values ); alert( "Value 2: " + temporaryArray[2] + " - " + finalArray[2].values ); var myGrid = $("#grid").kendoGrid( { columns: [ { title: temporaryArray[0] + " ", field: gridArray[0].values + " " } ], dataSource: { data:finalArray, pageSize:10 }, scrollable:false, pageable:true }); I've tried the following to add the object: for( var x = 0; x < finalArray.length; x++ ) { myGrid[columns] = { temporaryArray[x]

Formatted HTML data in Kendo grid column

喜夏-厌秋 提交于 2019-11-29 16:59:12
问题 Hi I have a Kendo Grid created in jquery with following code: Kendo Grid: $('#divFolderNotes').kendoGrid({ dataSource: data batch: true, columns: [ { field: "Text", title: "Note Text" }, { field: "CreatedByDisplayName", width: '190px', title: "Created By" }, { field: "CreatedDateTime", width: '190px', title: "Created Datetime" }, ], scrollable: true, sortable: true, reorderable: true, resizable: true, height: 250, selectable: "row", autoSync: true, editable: true,// "inline", navigatable:

Kendo Grid Foreign key column bind dynamically

ⅰ亾dé卋堺 提交于 2019-11-29 15:23:20
问题 @(Html.Kendo().Grid((IEnumerable<Doc.Web.Models.Common.ContactModel>)Model.contact_lst) .Name("grid") .Columns(columns => { columns.Bound(o => o.ContactID).Visible(false); columns.Bound(o => o.ContactName).Title("Contact Name"); columns.ForeignKey(p => p.CPOID, (System.Collections.IEnumerable)ViewData["CPOs"], "cpo_id", "contract_po") .Title("Company - Contact/Purchase Order"); columns.Command(command => { command.Edit(); command.Destroy(); }).Width(182); }) .ToolBar(toolbar => toolbar.Create

Kendo grid batch editing - making a single call to save

旧时模样 提交于 2019-11-29 14:34:09
问题 With Kendo grid batch editing turned on, I know that you can hook into the create, update and destroy commands where Kendo will send 3 separate commands to the server when you click on Save Changes. I was wondering if there was any way to send all three sets of updates as a single call to the server -like a transaction. Or even send each in a specified order, with a check for success before sending the next . The only way I could come up with was to have a custom Save Changes implementation

How to change the value of a kendo bound html input

半城伤御伤魂 提交于 2019-11-29 13:58:16
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 the new value isn't propagated to the grid. I guess because no change event occurs on the textbox. How

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

怎甘沉沦 提交于 2019-11-29 13:24:17
问题 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? 回答1: 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

Javascript runtime error: “object doesn't support property or method” in Internet Explorer

岁酱吖の 提交于 2019-11-29 12:59:42
I'm using kendo grids and they work fine for the CRUD operations. Now, I wanted to add filtering by adding the .Filterable() option to the grid's specification. Here's some code: <div id="datagrid"> @(Html.Kendo().Grid<SustIMS.Models.ConcessionModel>() .Name("datagrid_Concessions") .Columns(columns => { columns.Bound(c => c.Code).Title("Code"); columns.Bound(c => c.Description).Title("Description"); columns.Bound(c => c.TrafficOpeningDate).Title("Traffic Opening Date"); columns.Bound(c => c.CreationDate).Title("Creation Date"); }) .HtmlAttributes(new { style = "height: 534px;" }) .Filterable()

Get a reference to Kendo Grid from inside the error handler

ⅰ亾dé卋堺 提交于 2019-11-29 12:29:00
问题 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

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