kendo-grid

how to assign dataSource to DetailgridOptions(dataItem)

时光总嘲笑我的痴心妄想 提交于 2019-12-13 07:38:06
问题 I have a kendo grid which has buttons in every row, On click the buttons open a pop-up with different grid on each button click, and there is a detail teamplate in each row of pop-up grid which contains another grid. Now the problem is how to assign dataSource to the 3rd grid when detailGridOptions(dataItem) function is called. var p=0; $scope.detailGridOptions = function (dataItem) { return { dataSource: new kendo.data.DataSource({ schema: { model: { id: 'Id', fields: { Id: { type: 'number'

Kendo UI Grid .Net MVC - Column editable in Creation only

a 夏天 提交于 2019-12-13 07:26:18
问题 I've been searching how to make a column in a Kendo Grid ASP.Net MVC (Razor) Editable only while we are in creation and not editable while in update. Is there something special that will help me accomplish this task? 回答1: You can bind a custom function to the onEdit event and make that column readonly: @(Html.Kendo().Grid<DemoType>() .Name("grid") .Columns(columns => { /*...*/ }) .Events(events => events .Edit("onEdit") ) ) Javascript: function onEdit(e) { if (e.model.isNew() == false) { //$(

Checkbox is always coming as unchecked

泄露秘密 提交于 2019-12-13 07:06:58
问题 I have following Kendo Grid ans associated jQuery. On a button click, I need to know whether checkbox is checked. But at present it is showing 'false' always. How can we correct it? @Scripts.Render("~/bundles/jquery") <script type="text/javascript"> $(document).ready(function () { $('#btnMove').click(function () { var sourcegrid = $('#GridParent').data('kendoGrid'); //SOURCE GRID var destinationgrid = $('#ChildGrid').data('kendoGrid'); // DESTINATION GRID alert('Button Clicked'); var grid = $

convert Data between ActionResult and View

柔情痞子 提交于 2019-12-13 07:04:55
问题 In my project i use kendo grid to show data and in my ActionResult i use this code to get data : public ActionResult ShowData([DataSourceRequest] DataSourceRequest request, long studentid) { IQueryable<Models.Registration.RegistrationModel> query = from financeItem in db.RegistrationItems select new Models.Registration.RegistrationModel { RegisterId = financeItem.RegistrationId, Id = financeItem.Registration.Id, Date = financeItem.Registration.Date, StudentName = financeItem.Registration

My kendo grid is duplicating records

本小妞迷上赌 提交于 2019-12-13 06:57:17
问题 I have a kendo gri in my application. Here's a picture of it. And here's the code @(Html.Kendo().Grid<TekstenViewModel.Tekst>() .Name("Grid") .Columns(columns => { columns.Template(@<text></text>).ClientTemplate("<input type='checkbox'/>").Width(10).Hidden(!Model.Administrator); columns.Bound(product => product.RESOURCE_SET_NAAM).ClientTemplate("#= RESOURCE_SET_NAAM#"); columns.Bound(product => product.Naam).ClientTemplate("#= Naam#"); columns.Bound(product => product.Waarde).ClientTemplate("

how to add a new row with pre defined data in kendo grid?

旧街凉风 提交于 2019-12-13 06:26:48
问题 I'm trying to add a new row to a kendo grid with selected data from another kendo grid. Its showing a blank row but no data. Here is my code: var PunishmentGridDataSource = new kendo.data.DataSource({ schema: { model: { id: "DICP_ACTN_TYPE_CODE", fields: { DICP_ACTN_TYPE_SLNO: { editable: false }, DICP_ACTN_TYPE_CODE: { editable: false }, DICP_ACTN_TYPE_NAME: { editable: false } } } }, pageSize: 5, data: [ { DICP_ACTN_TYPE_SLNO: "1", DICP_ACTN_TYPE_CODE: "1", DICP_ACTN_TYPE_NAME:"aa" }] });

A button in a kendo ui grid doesn't work on mobile device

一笑奈何 提交于 2019-12-13 06:13:33
问题 I have an example, a kendo ui grid is added with Backbone.js. In the kendo ui grid I have a buttons to remove rows, but the buttons don't work on mobile devices. If I press a button repeteadly, it sometimes works. Why? I declare the button in kendoGrid.columns so: { command: [{ name: "destroy", text: "Remove", className: "ob-delete" } To remove a row and do something when button is clicked: $(document).on("click", ".grid tbody tr .ob-delete", function (e) { var item = grid.dataItem($(this)

Set title and additional properties to kendo ui grid

▼魔方 西西 提交于 2019-12-13 06:13:23
问题 I am using kendo ui grid to display data. I want to set title for the grid.Is there any way to set it. Also I want to set some additional/custom property for grid which will help to identify the grid uniquely. Any custom property I can set to grid so I can get its value when required. So in case if there are more instances on grid this will help. Please suggest on this. 回答1: Iterating through all your tables can be done using: $.each($(".k-grid"), function (idx, grid) { // Do whatever you

Filter for “UnitPrice” and “ProductID” column

99封情书 提交于 2019-12-13 05:58:14
问题 I wanted to filter UnitPrice and ProductID . This is the sample, you want more using the jsfiddle link. Check this jsfiddle for more detail & work my program in that //change event $("#category").keyup(function () { var selecteditem = $('#category').val(); var kgrid = $("#grid").data("kendoGrid"); selecteditem = selecteditem.toUpperCase(); var selectedArray = selecteditem.split(" "); if (selecteditem) { }); var orfilter = { logic: "or", filters: [] }; var andfilter = { logic: "and", filters:

Kendo Grid: getting an instance in a Angular directive

落爺英雄遲暮 提交于 2019-12-13 05:43:10
问题 this follows directly on from this question (with an additional question hence I thought should be a new post?) The link above shows how to get a grid instance in Angular (thanks to Lars) So, following on from this last example, I now have added the following directive.. <body> <div data-ng-app="app"> <div data-ng-controller="Grid as vm"> <div id='aa'> <div pckendo id='bb' kendo-grid='grid' k-options="vm.options"></div> </div> </div> </div> </body> and in the .js added angular .module("app",