Hello,
I have a problem in my angular Kendo Grid not passing specified values to the controller.
This problem is very similar to these posts but the solutions didn't make a difference.
http://www.telerik.com/forums/how-do-i-use-the-datasourcerequest-object-as-an-asp-net-mvc-action-parameter
and
http://www.telerik.com/forums/datasourcerequest-sort-is-null
Here is the description:
I am so close and yet so far...
I am using an angular kendo grid with MVC end point for data. I have no problem getting the data to show so then I moved on to paging. Client side paging works but since the record count is high I would prefer serverside paging.
This is where I am missing something. My grid displays "Showing 1-5 of 18" so it is somehow parsing the count for the grid legend but the actual grid shows all 18 rows??
my _layout has among other files:
<script src="@Url.Content("~/Scripts/kendo/2016.1.412/kendo.aspnetmvc.min.js")"></script>
my grid:
$("<div/>").appendTo(e.detailCell).kendoGrid({ dataSource: { transport: { read: function (f) { $http.get('http://localhost:59722/SCat/GetSubCategories?categoryid=' + e.data.Id). success(function (data, status, headers, config) { f.success(data) }). error(function (data, status, headers, config) { alert('something went wrong with subCategories') console.log(status); }); }, create: function (c) { alert('adf'); $http.post('http://localhost:59722/Cat/AddNewSubCategory'). success(function (data, status, headers, config) { f.success(data) }). error(function (data, status, headers, config) { alert('something went wrong with update') console.log(status); }); } }, pageSize: 5, serverPaging: true, serverFiltering: true, schema: { data: "Data", total: "Total", errors: "Errors" } }, pageable: true, filterable: true, editable: "inline", toolbar: ["create"], columns: [ { field: "SubCategoryName", title: "Category Name" }, { field: "SCategoryId", title: "Parent Id" }, { command: ["edit"]} ] }) } })
MVC Action:
public async Task<JsonResult> GetSubCategories([DataSourceRequest] DataSourceRequest request, int? categoryid){ int categoryId = categoryid ?? -9999; if (categoryId == -9999) { return Json("[{Error -9999 for categoryId}]"); } HttpResponseMessage responseMessage = await client.GetAsync(url + "/" + categoryId); if (responseMessage.IsSuccessStatusCode) { var responseData = responseMessage.Content.ReadAsStringAsync().Result; var x = JsonConvert.DeserializeObject<List<SubCategories>>(responseData); return Json(x.ToDataSourceResult(request) , JsonRequestBehavior.AllowGet); } return Json("[{Error}]"); }
Fiddler 200 json
{ "Data":[ {"Id":1,"SubCategoryName":"asdfe","CategoryId":1}, {"Id":3,"SubCategoryName":"Self-Righteousness","CategoryId":1}, ...removed brevity... {"Id":18,"SubCategoryName":"Viuyhj","CategoryId":1} {"Id":19,"SubCategoryName":"zcxv","CategoryId":1} ],"Total":18,"AggregateResults":null,"Errors":null}Now I think I am missing something in my angular grid because my DataSourceRequest is ALWAYS full of default values.
Further if I explicitly assign the page value everything works.
public async Task<JsonResult> GetSubCategories([DataSourceRequest] DataSourceRequest request, int? categoryid){ request.PageSize = 5; ....snip}o it has something to do with my Angular grid but I'm missing what???
Hello,
I encountered strange behaviour of kendo ui tooltip in Chrome.
Steps to reproduce:
=> if you hit the border tooltip starts appearing and disappering forever
Regards
Dirk
Just wondering if this is something wrong that I am doing, intended mechanics or a bug.
See dojo: https://dojo.telerik.com/EfAQemOn
If you change the state of the "switch" it does not register that the underlying value has been changed and maintains the previous recorded value. If you interact with the view model via the checkbox it is recording the change state.
Is this something that is easy to fix without having to check the state value via the onchange event which currently seems to be the way you are testing for the change state value?
just incase I have copied the dojo code here for you as well.
<!DOCTYPE html>
<html>
<head>
<base href="https://demos.telerik.com/kendo-ui/switch/mvvm">
<style>html { font-size: 14px; font-family: Arial, Helvetica, sans-serif; }</style>
<title></title>
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.1.115/styles/kendo.material-v2.min.css" />
<script src="https://kendo.cdn.telerik.com/2019.1.115/js/jquery.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2019.1.115/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="../content/shared/styles/examples-offline.css">
<script src="../content/shared/js/console.js"></script>
</head>
<body>
<div id="example">
<div class="demo-section">
<input data-role="switch"
data-bind="enabled: isEnabled, visible: isVisible, checked: isChecked, events: { change: onChange }" />
</div>
<input type="checkbox" data-bind="checked: isChecked, events: { change: onChange }"/> Change switch state
<div class="box">
<h4>Console log</h4>
<div class="console"></div>
</div>
</div>
<style>
.demo-section {
text-align: center;
}
</style>
<script>
var viewModel = kendo.observable({
isChecked: true,
isEnabled: true,
isVisible: true,
onChange: function (e) {
kendoConsole.log("event :: change (" + (e.checked ? "checked" : "unchecked") + ") \r\n calling Directly::" + viewModel.isChecked +"\r\nCalling Via Get Method:: " + viewModel.get('isChecked'));
}
});
kendo.bind($("#example"), viewModel);
</script>
</body>
</html>
Hi,
I am looking to make changes to the flow of editing recurrences. Is it possible to change the order of when to show the dialog for selecting whether to edit the current occurrence or the series, so it is shown after the edit dialog?
I am looking to do the following: Whenever an event is edited it is always the current instance that is shown. After changes have been made in the edit dialog, the user is shown the options of whether to apply the changes to the series or to the instance. Is this possible?
Also is it possible to add an option to the "edit recurrence" dialog? I want to add the option of changing only the current instance edited and future instances.
https://demos.telerik.com/kendo-ui/grid/detailtemplate
as above url: Grid / Detail template:
Actually, we have a kendo-grid: 10 master-items, and each master item has its detail.
Questions:
1.just one edit button outside the grid , could it edit total details of 10 master-items ?
2.just one save button outside the grid, could it save total modified detail of 10 master-items?
where to find the sample code or how to do?
thanks a lot
I have written some JavaScript (as the Upload event) to pass the additional parameters (inventoryID and imageType) which are always passed successfully.
function imageUploadUpload(e) {
e.data = { inventoryID : @Model.InventoryID, imageType: imageType };
}
I have tried removing the Upload event/handler to see if this makes a difference, but still have the same problem.
Any idea what is going on?
Thank you.
*** EDIT ***
I found the solution here. The name of the Upload component must match the name of the parameter that holds the HttpPostedFileBase. I had named my Upload component imageUpload. When I renamed the parameter to imageUpload, it worked fine!

I have a tag like this
<button data-bind="attr: { data-placeholder: Placeholder(512) }" />
Usually I trigger the change like this: model.trigger('change', { field: 'Placeholder'}) but this doesn't work in this case.
Could anyone help me?
Thanks!
