Hi,
I am following example the here to implement kendo ui treeview with remote data binding http://demos.telerik.com/kendo-ui/treeview/remote-data-binding
On expanding a node I need to dynamically pass couple of parameters to get the child items. The given example works perfectly for one parameter. How can I add another parameter? The value of my second parameter comes from one of the columns of the datasource itself.
Thanks


Hi!
I need to share my current bundle config and _Layout so that someone can correct me if I'm loading too many CSS/Scripts then needed.
BundleConfig:
public class BundleConfig{private const string KendoVersion = "2016.3.1118";public static void RegisterBundles(BundleCollection bundles){ #region Scripts bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js", "~/Scripts/jquery.scrollUp.min.js", "~/Scripts/moment.min.js")); bundles.Add(new ScriptBundle("~/bundles/jqueryMigrate").Include( "~/Scripts/jquery-migrate-3.0.0.min.js")); bundles.Add(new ScriptBundle("~/bundles/niceScroll").Include( "~/Scripts/NiceScroll/jquery.nicescroll.min.js")); bundles.Add(new ScriptBundle("~/bundles/perfectScrollbar").Include( "~/Scripts/perfect-scrollbar.jquery.min.js")); bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( "~/Scripts/jquery.validate*")); bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( "~/Scripts/modernizr-*")); bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( "~/Scripts/bootstrap.min.js", "~/Scripts/respond.min.js")); bundles.Add(new ScriptBundle("~/bundles/kendo").Include( "~/Scripts/kendo/" + KendoVersion + "/kendo.all.min.js", "~/Scripts/kendo/" + KendoVersion + "/kendo.angular2.min.js", "~/Scripts/kendo/" + KendoVersion + "/kendo.aspnetmvc.min.js", "~/Scripts/kendo/" + KendoVersion + "/kendo.timezones.min.js", "~/Scripts/kendo/" + KendoVersion + "/cultures/kendo.culture.en-US-Custom.min.js", "~/Scripts/kendo/" + KendoVersion + "/jszip.min.js")); bundles.Add(new ScriptBundle("~/bundles/custom").Include( "~/Scripts/globalize.js", "~/Scripts/metisMenu.min.js", "~/Scripts/buzz.js", "~/Scripts/dist/site.js", "~/Scripts/App/Module/Common.js")); #endregion #region CSS bundles.Add(new StyleBundle("~/Content/css").Include( "~/Content/bootstrap.min.css", "~/Content/site.css", "~/Content/normalize.css")); bundles.Add(new StyleBundle("~/Content/custom/css").Include( "~/Content/metisMenu.min.css", "~/Content/site/site.css", "~/Content/animate.css")); bundles.Add(new StyleBundle("~/Content/kendoThemeCommon/css").Include( "~/Content/kendo/" + KendoVersion + "/kendo.common.min.css")); bundles.Add(new StyleBundle("~/Content/kendoThemeCommonBootstrap/css").Include( "~/Content/kendo/" + KendoVersion + "/kendo.common-bootstrap.min.css")); bundles.Add(new StyleBundle("~/Content/kendoThemeBootstrap/css").Include( "~/Content/kendo/" + KendoVersion + "/kendo.bootstrap.min.css")); bundles.Add(new StyleBundle("~/Content/kendoRtl/css").Include( "~/Content/kendo/" + KendoVersion + "/kendo.rtl.min.css")); bundles.Add(new StyleBundle("~/Content/kendoMobile/css").Include( "~/Content/kendo/" + KendoVersion + "/kendo.mobile.all.min.css")); bundles.Add(new StyleBundle("~/Content/kendoDataViz/css").Include( "~/Content/kendo/" + KendoVersion + "/kendo.dataviz.min.css", "~/Content/kendo/" + KendoVersion + "/kendo.dataviz-bootstrap.min.css")); #endregion bundles.IgnoreList.Clear(); //BundleTable.EnableOptimizations = true;}Layout:
<head> <meta charset="utf-8" /> <title>@ViewBag.Title - System</title> <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" /> <meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, width = device-width"> <!-- css --> @Styles.Render("~/Content/css") @Styles.Render("~/Content/custom/css") @Styles.Render("~/Content/kendoThemeCommon/css") @Styles.Render("~/Content/kendoThemeCommonBootstrap/css") @Styles.Render("~/Content/kendoThemeBootstrap/css") @Styles.Render("~/Content/kendoRtl/css") @Styles.Render("~/Content/kendoMobile/css") @Styles.Render("~/Content/kendoDataViz/css") <!-- jQuery --> @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/jqueryMigrate") @Scripts.Render("~/bundles/bootstrap") @Scripts.Render("~/bundles/niceScroll") @Scripts.Render("~/bundles/kendo") <script type="text/javascript"> kendo.culture("en-US"); </script> @Scripts.Render("~/bundles/modernizr") @Scripts.Render("~/bundles/custom") <script src="https://use.fontawesome.com/06c55d21d7.js"></script></head>Result:
I'm not getting any specific warning in console of hosting browsers but when using the Chrome's extension for Kendo, I get repeated messages regarding common.css missing. Now, I'm going for the Bootstrap style all-out. I need a all-good for the default desktop setup. I'm still a bit confused about Mobile and DataViz and DataViz Mobile. I'm about to start dashboards so I'll be loooking at mobile and DataViz too.

I have a remote datasource/grid with something like this as part of the datasource schema model:
model: {fields: {department_id: {type:"number"}, department: {type: "object"} ...
where the nested department object includes fields "id" and "prettyName". The grid uses incell editing and a "save" button on the toolbar. The columns include a field for the "department_id":
{field: 'deptID', title:"Department",
template: "#:department.prettyName#",
editor: function(container, options) {
$('<input required name="' + options.field + '"/>')
.appendTo(container)
.kendoDropDownList({
dataSource: remoteDepartmentDatasource,
dataTextField: "prettyName",
dataValueField: "id", ...
}
This works to a point - the nested "department.prettyName" displays in the grid via the template, and with incell editing the dropdown list (which is fed records identical to the nested "department" object) correctly changes the "department_id" field to the id selected from the dropdown. But since the grid's display value "prettyName" is coming from the original nested "department" in the grid row's dataSource record, once the editor is exited the grid displays a stale value until the update is made to the server and the server returns an updated record, which isn't until the user decides to click "Save changes".
Is there any clean way to bind things to have BOTH the department_id AND the department object updated from the edit process's dropdown list? Or is there an event I could hook into, perhaps the dropdown's "close", where I would know enough to push the "department" object onto the record in the grid's dataSource?
I am using kendo ui router and want to replace a URL parameter on each change of the route. So on the change event of the router I have the following code:
window.history.replaceState({}, document.title, getUpdatedUrl())The parameter I want to add is updated successfully, but when I navigate back or forward the kendo ui router no longer catches these events, and does not navigate to the appropriate view (the page URL changes properly). Any ideas how to fix this?
I have a grid that is using the popup editor with customized create and update templates. The create is working just fine, and the update works if I change one of the dropdowns. However, if I only change some of the text in the textbox and click the Update button, the update function in the dataSource is not run, even though the dataSource sync function runs. Do I need to call the onChanges event of the textbox?
I am using Angular for this application, and when I make a change in the textbox, the ng-pristine class is removed and the ng-dirty class is added.
I have a kendogrid and when I add a new record and rebind the grid, the new record is not in the grid, however if I use the filter for it then I see it, but to actually see it in the grid I have to refresh my page.
When the page loads it calls this function
function GetCustomerGridData() { kendo.ui.progress($("#Customer-Grid"), true); $.ajax({ type: "GET", url: URLParam.GetActiveCustomersForTheGrid, dataType: "json", contentType: "application/json; charset=utf-8", success: function (data, textStatus, jqXHR) { LoadCustomerGrid(data); kendo.ui.progress($("#Customer-Grid"), false); } });}
The LoadCustomerGrid is this
function LoadCustomerGrid(newData) { CreateCustomerGrid(newData);}
The grid itself is..
var customerGrid, CreateCustomerGrid = function (newData) { customerGrid = $("#Customer-Grid").kendoGrid({ dataSource: { data: newData }, schema: { model: { CustomerID: { type: "number" } } }, filterable: { mode: "row" }, columns: [ { template: "<input type='checkbox' class='checkbox' />", width: "30px" } { field: "LastName", title: "Last Name", filterable: { cell: { showOperators: false, operator: "contains", inputHeight: "34px" } } }, { field: "FirstName", title: "Name", filterable: { cell: { showOperators: false, operator: "contains" } } }, { field: "Phone", title: "Phone", filterable: { cell: { showOperators: false, operator: "contains" } } }, { field: "Address", title: "Address", filterable: { cell: { showOperators: false, operator: "contains" } } }, { field: "City", title: "City", filterable: { cell: { showOperators: false, operator: "contains" } } }, { field: "Zip", title: "Zip", filterable: { cell: { showOperators: false, operator: "contains" } } } ], scrollable: true, sortable: true, pageable: { pageSize: 20 }, selectable: "row", height: $("#Customer-Grid").closest(".col-height-full").height() - 60, change: function (e) { // Function call goes here var detailRow = this.dataItem(this.select()); var optionID = detailRow.get("CustomerID") } }).data("kendoGrid"); }
When I go to add a record I use a popup
function CustomerPopupEditor() { $("#showCustomerEdit").append("<div id='window'></div>"); var myWindow = $("#window").kendoWindow({ position: { top: 100, left: "30%" }, width: "40%", title: "Add Customer", content: "/Customer/CustomerEditor", modal: true, actions: [ "Close" ], close: function (e) { $("#window").data("kendoWindow").destroy(); } }).data("kendoWindow"); myWindow.open(); GetStates(); HomeStorage.Keys.AddOrEdit = "Add";}
and when add a new record and click the save button, this function is called
function SubmitNewCustomer() { var customer = NewCustomerToSubmit(); GetAssignmentIDs(); $.ajax({ type: "POST", url: URLParam.AddNewCustomer + "?assignments=" + HomeStorage.Keys.AssignmentIDString, dataType: "json", contentType: "application/json; charset=utf-8", data: JSON.stringify(customer), success: function (data, textStatus, jqXHR) { HomeStorage.Keys.NewCustomerID = data.id; }, complete: function (e) { GetCustomerGridData(); ClearFields(); } })}
and when I close the popup on a button click event this is called
$("#btnCancel").click(function () { ClearFields(); GetCustomerGridData(); CloseTheWindow();});
In the SubmitNewCustomer function I have tried putting the GetCustomerGridData() in its success function and that didnt work either.
The data being returned for the GetCustomerGridData() has over 30K records, but I dont think that should matter much.
Any idea what I am missing?

Lets say, I have a model like the following:
public class AssignmentListViewModel
{
public string JsonAssignmentList { get; set; }
}
Loading the model:
model.JsonAssignmentList = Newtonsoft.Json.JsonConvert.SerializeObject(assignmentList.Assignments);
On the client when I create new kendo.data.TreeListDataSource, I try to do the following and get error
"SCRIPT1028: Expected identifier, string or number"
var json = JSON.parse(@Model.JsonAssignmentList);
var dataSource = new kendo.data.TreeListDataSource({
@*data: JSON.stringify(@Model.JsonAssignmentList),*@
data: json,
// Enable batch updates
batch: true,
// Define the model schema
schema: {
model: {
id: "Id",
fields: {
Id: { type: "number", editable: false, nullable: false },
parentId: { from: "ChildAssignmentListId", type: "number", defaultValue: 0 },
Step: { validation: { required: true } },
AssigneeDisplayName: { validation: { required: true } },
Description: { validation: { required: true } },
Status: { validation: { required: true } },
StatusText: { validation: { required: true } },
Instructions: { validation: { required: false } },
//Deadline: { validation: { required: false } },
DeadlineDueDateText: { validation: { required: false } }
}
}
}
});
How can I return json string from the controller and bind it to a kendo treelist?
I have 3 pie charts
They all sit below each other but they are all different widths as the legend is on the left and the lengths of the legend lable varies.
How can I specify a fixed with for the legend or pie chart so that they are consistant size
