Hi,
I wasnt sure what category this question belongs as I dont know if the issue is Grid or DataSource related. So here it is.
I've created a kendoWindow that contains a KendoGrid with a height of 350px. The problem Im having is that the Grid is not maintaining the height (and impl scroll overflow) when the window is opened multiple times.
Here is the code, (apologies for its length, Im this one bug away from it being complete) http://dojo.telerik.com/uCayI
The problem persists regardless of is the dataSource is static or remote.
You can see the bug if you run the code then open either of the windows mulitple times, you'll see the lower buttons vanish.
Please ask if anything is unclear.
Regards,
Grant


Hello,
I have model that looks like
public class VacUserSecurityModel
{
private bool isCurrentUser;
public VacUserSecurityModel()
{
this.Claims = new List<UserClaim>();
}
public string Id { get; set; }
public string Email { get; set; }
public string UserName { get; set; }
[UIHint("ClaimsEditor")]
public List<UserClaim> Claims { get; set; }
}
Here is a grid
@(Html.Kendo().Grid<VacUserSecurityModel>
()
.Name("allGrid")
.DataSource(datasource => datasource.Ajax().Read(read => read.Action("ReadAllUserClaims", "Authorization"))
.Update(update => update.Action("UpdateUserClaims", "Authorization"))
.Model(model =>
{
model.Id(p => p.Id);
model.Field(p => p.UserName).Editable(false);
model.Field<List<UserClaim>>(e => e.Claims);
}))
.NoRecords(x => x.Template("<div class='k-grid-norecords-template'>No records</div>"))
.Editable(editable => editable.Mode(GridEditMode.PopUp))
.HtmlAttributes(new { style = "height:550px;" })
.Columns(columns =>
{
columns.Bound(c => c.Id).Visible(false).Title("ID");
columns.Bound(c => c.UserName).Width(250).Title("User");
columns.Bound(c => c.Claims).ClientTemplate("#=claimsTemplate(Claims)#");
columns.Command(commands => { commands.Edit(); });
})
)
Claims Editor:
@model Models.Authorization.VacUserSecurityViewModel
@(Html.Kendo().MultiSelect()
.Name("RoleClaims")
.Placeholder("Select roles")
.DataTextField("ClaimValue")
.DataValueField("ClaimValue")
.BindTo((System.Collections.IEnumerable) ViewData["RolesDictionary"]))
How do I need to change the grid definition to bind Claims property to be able to edit this collection? During update, Claims property has old values regardless what I select.
Any help will be appreciated.
return tsmsent.TSMSDets .OrderBy(tsms => tsms.Task) .Select(tsms => new TimeSheetDetails { Task = tsms.Task, Day1 = tsms.Day1, Day2 = tsms.Day2, Day3 = tsms.Day3, Day4 = tsms.Day4, Day5 = tsms.Day5, Day6 = tsms.Day6, Day7 = tsms.Day7 }).ToDataSourceResult(request.Take, request.Skip, request.Sort, request.Filter);return tsmsent.GetTimeSheet() .OrderBy(tsms => tsms.Task) .Select(tsms => new TimeSheetDetails { Task = tsms.Task, Day1 = tsms.Day1, Day2 = tsms.Day2, Day3 = tsms.Day3, Day4 = tsms.Day4, Day5 = tsms.Day5, Day6 = tsms.Day6, Day7 = tsms.Day7 }) .AsQueryable().ToDataSourceResult(request.Take, request.Skip, request.Sort, request.Filter);I'm writing an inventory system using mostly the Kendo UI Grid to process the invoicing system. When I'm creating a new invoice I need to create the invoice first, and then add the line items to the invoice and save it. I'm creating my invoice through an AJAX request and then using the create method of the DataSource to add the line items. I'm able to submit the invoice through my API and get back a response from the server with the newly created object, however how do I get the newly created object to interact with my Grid? Specifically I need the ID of the new invoice to add to the InvoiceID field of each of the line items of my Grid.
My thinking is that the best place to create the Invoice is in the saveChanges event of the Grid. Due to the asynchronous nature of JavaScript, which is somewhat new to me, how do I gt the object? Here is my code:
$("#grid").kendoGrid({ dataSource: { batch: false, transport: { create: { url: ... }, contentType: "application/json", type: "POST" }, parameterMap: function (data, operation) { return JSON.stringify(data); } }, schema: { data: "Data", total: "Total", model: { id: "InvoiceID", fields: { InvoiceID: { editable: "false", type: "number" }, ClientID: { type: "number" }, LineItemID: { type: "number" }, ... } } } }, pageable: true, toolbar: ["create", "save", "cancel"], columns: [ { ... }, { command: ["edit", "destroy"], width: "300px" }], editable: true, save: function(e) { ... } }, saveChanges: function (e) { newInvoice = CreateInvoice(); } }); });});function CreateInvoice() { invoice = { ClientID: $('#ClientID').text(), Status: 1, ... }; $.ajax({ url: '/api/invoice/', type: 'POST', data: JSON.stringify(invoice), contentType: "application/json", });};The invoice is created successfully and I need to take the ID of that object and apply it to the line items of each row in the Grid. What is the best way of doing this?
Hello,
i have problem with kendo MVC Grid with presist state. After I load grid setting from localStorage (Grid is grouped by Subject column) and click on filter icon in column which has enabled MultiCheckbox filtering (DP or ZS) , I got this error in js console:
VM643:3 Uncaught ReferenceError: DruhPrijmu_Code is not defined(anonymous function)@ VM643:3render @ kendo.all.js:175proxy @ jquery-1.10.2.js:841createCheckBoxes @ kendo.all.js:34934refresh @ kendo.all.js:34901proxy @ jquery-1.10.2.js:841trigger @ kendo.all.js:124_process @ kendo.all.js:6882success @ kendo.all.js:6627success @ kendo.all.js:6555n.success @ kendo.all.js:5547fire @ jquery-1.10.2.js:3062fireWith @ jquery-1.10.2.js:3174done @ jquery-1.10.2.js:8249callback @ jquery-1.10.2.js:8792XMLHttpRequest.send (async)send @ jquery-1.10.2.js:8720ajax @ jquery-1.10.2.js:8150read @ kendo.all.js:5549read @ kendo.aspnetmvc.js:250(anonymous function) @ kendo.all.js:6552_queueRequest @ kendo.all.js:6742read @ kendo.all.js:6545query @ kendo.all.js:6925_query @ kendo.all.js:6956sort @ kendo.all.js:7013_click @ kendo.all.js:36725proxy @ jquery-1.10.2.js:841dispatch @ jquery-1.10.2.js:5109elemData.handle @ jquery-1.10.2.js:4780After this error grid stop work...
This is problem occurs only with multicheckob filtering column.
This is a my sample code:
@(Html.Kendo().Grid<Playground.Models.ODU.ODUZaznamViewModel>() .Name("GridODU") .Columns(columns => { columns.Bound(item => item.Subjekt_Id).Width(120).Title("ID subjektu"); columns.Bound(item => item.Subjekt_ObchodniNazev).Width(220).Title("Subjekt"); columns.Bound(item => item.DruhPrijmu_Code).Width(120).Title("DP").Filterable(ftb => ftb.Multi(true).Search(true)); columns.Bound(item => item.ZuctovaciSymbol_Code).Width(120).Title("ZS").Filterable(ftb => ftb.Multi(true).Search(true)); }) .DataSource(dataSource => dataSource .Ajax() // .Batch(false) .ServerOperation(true) .Events(events => events.Error("error_handler")) .PageSize(20) .Model(model => { model.Id(p => p.ID); }) .Read(read => read.Action("ODURead", "Home")) ) .Scrollable() .ColumnMenu() .Events(x => x.DataBound("saveState")) .Groupable() .Filterable() // ftb => ftb.Mode(GridFilterMode.Row) // .Events(e => e.ColumnMenuInit("columnMenuInit")) .Reorderable(x => x.Columns(true)) .Pageable() // Enable paging .Sortable() // Enable sorting .Resizable(resize => resize.Columns(true)))<script type="text/javascript"> function error_handler(e) { if (e.errors) { var message = "Errors:\n"; $.each(e.errors, function (key, value) { if ('errors' in value) { $.each(value.errors, function () { message += this + "\n"; }); } }); alert(message); } } function saveState(e) { e.preventDefault(); localStorage["kendo-grid-options"] = kendo.stringify($("#GridODU").data("kendoGrid").getOptions()); }; $(function (e) { var options = localStorage["kendo-grid-options"]; if (options) { $("#GridODU").data("kendoGrid").setOptions(JSON.parse(options)); } else { $("#GridODU").data("kendoGrid").dataSource.read(); } });</script>
Model:
namespace Playground.Models.ODU{ public class ODUZaznamViewModel { public long ID { get; set; } public virtual int Subjekt_Id { get; set; } public string Subjekt_ObchodniNazev { get; set; } public virtual string DruhPrijmu_Code { get; set; } public virtual string ZuctovaciSymbol_Code { get; set; } }}
It is a bug ?
The problem detected in this versions of KENDO
Kendo UI version: "2016.1.412"
Kendo UI version: "2016.2.714"
.
Thanks for help !

I'm not sure I'm totally getting The Kendo Way of the doing things yet. My instinct is to get the data I need from the grid, do what I need with it, then manually update the grid. It seems to me, the grid want to be the single point of truth for data and functions.
I am using server-side paging with an API. The API can cope with pageSize and page parameters, which are defined in the grid. That means I am only ever seeing, say, 20 records at a time. To do this, the read function has an options param that "magically" contains pageSize and page.
vm.masterGrid.dataSource = new kendo.data.DataSource({ pageable: { pageSizes: true, buttonCount: 5 }, pageSize: 20, serverPaging: true, serverSorting: true, serverFiltering: true, transport:{ read: function(options) { return vm.getOrders(options); } }, }});I want to be able to check one or several or all, or even all-minus-one orders, and send them "down the pipe".
Each row has a checkbox, and then there is a 'Select All' button.
Since the grid only sees a small window of data, I don't think I can keep track of all order states in the front end. (If I'm on page one, the grid knows nothing about any orders except the first 20).
So, my solution is to have a separate end-point: api/orders/selectall. It has no params (except pageSize and page) and simply tells the back end to flag all orders as 'in-progress'. Upon return, it needs to deliver tohse 20 records and tell the grid to refresh.
So my question(s), after all that is/are:
How does my select all button interact with the grid?
I need to
Do I call read()? How? I'm outside the grid. vm.masterGrid.dataSource.read()?
vm.selectAll = function () { console.log(vm.masterGrid.gridOptions) var options = { data: { pageSize: 20, page: 1 } }; vm.selectAllOrders(options);};Hi,
we develope an application with Kendo mobile and we use the router for navigation :
router.navigate("viewPath");
In application there is a situation when we need to submit a saving dialog to navigate to other view. Sometimes in this case occures a problem that the application just flashes like it was navigated to the next view (also in code it is acting like that) but the previous view is freezed on the top.
For example you have an app with views:
some home page -> products view -> product detail
- I navigate from home page to products view and to specific product - when I want to save a product detail a dialog is shown - I submit the saving and it should go back to products view. But it doesnt. When I use a native android back button it flashes and seems to navigate to products view for a second but still the product detail is freezed on the window after that (if you press native back buttons more times it asks if you want to close the app like you were on the home page).
Is it possible to solve the navigation some other way to avoid this problem?
Thank you in advance.
