Hi
Is it possible to have a command and field in 1 column of a Grid? Something along the lines of::
Where in line number 11 below the 3 column would include the data value for products and a button (in this case just to edit the products for 1 line in grid)
01.var grid = $("#grid").kendoGrid({02. dataSource: {03. pageSize: 20,04. data: createRandomData(50)05. },06. pageable: true,07. height: 550,08. columns: [09. { field: "FirstName", title: "First Name", width: "140px" },10. { field: "LastName", title: "Last Name", width: "140px" },11. { field: "products", command: { text: "Edit Product List", click: showDetails }, title: " ", width: "180px" } ]12.}).data("kendoGrid");
Thanks in Advance
Hello,
We are
trying to do implement a unique requirement for our customer. For the kendo
grid, we have implemented inline editing, but we have a lot of columns and some
of the columns has a lot of text inside like the comment type columns. it makes
it really hard for the customers to do an inline editing on those columns. For
their convenience, we are trying to open up a pop up text editor when they
click on certain columns that typically have a lot of texts, they are able to
add the comments there, then we send the added comments to the respective cell
and be able to save the grid.
Also, we
have populating the grid columns dynamically.
The
problem here is, after adding the comments and clicking on OK, on the UI the
cell has the new comments but it doesn't look like it is being updated. As a
result kendo grid doesn't know something has changed, and our save all changes/
cancel buttons are still disabled. I tried enabling them by editing other
columns, and I clicked on the save all changes button, and it said saved successfully,
but even though the comment cell has new text values, it didn't save them,
since I don't see those new comments after the grid refresh.
It looks
like the editor text value is not binding to the cell properly. I am attaching
a couple of files here, the first one(popup editor.PNG)
has the piece of code where it opens the popup if the column type is of
comment, the second one(okclick.PNG) has the code which triggers the function on OK
click on the editor popup, and the third one(popup.PNG) is the editor pop up.
I think the edited text is not binding properly. Any help is appreciated. Thank you

Hi,
i see there is helpful insight as to how to create boolean checkbox fields using javascript code http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/Templates/grid-with-checkbox-column . But I am often unsure how to translate this code to make it work for a grid that uses PHP Wrapper code.
Any insights as to how to adapt the checkbox field code to work for UI Grid PHP Wrapping would be greatly appreciated. Thank you!
I'm using donut chart on a page with AngularJS and it works perfectly fine except that on IE and Edge the legend and title texts are not visible at all (see the attachments).
Here is the code for creating the chart options:
01.function createDonutChartOptions() {02. $scope.donutChartOptions = {03. title: {04. visible: true,05. position: "top",06. font: constants.font,07. color: constants.colors.dark,08. text: $filter('localization')('Report_Donut_Chart_Title')09. },10. chartArea: {11. background: constants.colors.background12. },13. tooltip: {14. visible: true,15. template: "#= category# #= kendo.toString(value,'n2')#%",16. font: constants.font17. }18. };19.};Here is the code for creating the data series:
01.function createDonutChartDataSeries() {02. $scope.donutChartDataSeries = [03. {04. field: 'percentage',05. categoryField: 'categoryName',06. visibleInLegendField: 'visibleInLegend',07. overlay: {08. gradient: "none"09. },10. labels: {11. visible: true,12. background: 'transparent',13. position: 'outsideEnd',14. template: '#=category#',15. font: constants.font16. }17. }18. ];19.};Here is the code for getting the data for the chart:
01.//Donut data. 02. 03.reportService.getDonutChartDataSource($scope.selectedGroup.key).then(function(donut) {04. donut.data.forEach(function (item) {05. if (item.status === constants.donutChartStatuses.finished) {06. item.color = $("#donut-chart-finished").css("color");07. } else {08. item.color = $("#donut-chart-unfinished").css("color");09. }10. });11. createDonutChartDataSeries();12. createDonutChartOptions();13. var newHeight = donut.data.length * 100;14. $scope.donutChartDataSource = new kendo.data.DataSource({15. data: donut.data,16. group: {17. field: "pathId"18. }19. });20. $scope.isDonutChartReady = true;21. if (newHeight >= 100) $("#donut-chart").css({ "height": newHeight });22. $timeout(function () {23. $scope.donutChart.redraw();24. }, 200);25. });Here is the HTML code:
01.<div class="col-md-6" ng-show="isDonutChartReady">02. <div kendo-chart="donutChart"03. k-legend="{ position: 'bottom' }"04. k-series-defaults="{ type: 'donut', startAngle: 270 }"05. k-options="donutChartOptions"06. k-series="donutChartDataSeries"07. k-data-source="donutChartDataSource"08. class="report-donut-chart" id="donut-chart"></div>09.</div>I can't understand what I'm doing wrong.
Could you please help me out?
I have a Kendo UI Grid that sends data to my server through ASP.NET Web API. I have data in an AutoComplete control and a DatePicker control that I want to send as well to the API through the Kendo UI Grid. In the example below I want tot send the ClientID from the AutoComplete as well as the date from the DatePicker to the server. How do I do this?
<script> $(document).ready(function () { $("#client").kendoAutoComplete({ template: "<span class='client-id'>#= AccountNumber #</span> <span class='branch-id'>#= (Branch == null) ? ' ' : Branch #</span> <span class='department-id'>#= (Department == null) ? ' ' : Department #</span> #= Name # <span style='visibility: hidden'>^#=ClientID#</span>", dataTextField: "Name", height: 520, dataSource: { transport: { read: "http://localhost:53786/api/client", type: "json" }, schema: { model: { fields: { ClientID: { type: "number" }, AccountNumber: { type: "number" }, Branch: { type: "string" }, Department: { type: "string" }, Name: { type: "string" } } } }, pageSize: 80, serverPaging: true, serverFiltering: false }, select: function(e) { var item = e.item.text().split("^"); var ClientID = item[1]; } }); // create DatePicker from input HTML element $("#datepicker").kendoDatePicker({ format: "dddd, MMMM d, yyyy" }); $("#grid").kendoGrid({ dataSource: { transport: { create: { url: "http://localhost:53786/api/workorder/0/workorderdetails", contentType: "application/json", type: "POST" }, read: { url: "http://localhost:53786/api/workorder/0/workorderdetails", dataType: "json" }, update: { url: "http://localhost:53786/api/workorder/0/workorderdetails", dataType: "json", type: "PUT" }, destroy: { url: function (workorderdetail) { return "http://localhost:53786/api/workorder/1/workorderdetails" + workorderdetail.WorkOrderDetailID; }, contentType: "application/json", type: "DELETE" }, parameterMap: function (data, operation) { return JSON.stringify(data); } }, schema: { data: "Data", total: "Total", model: { fields: { WorkOrderID: { type: "number" }, PriceCodeID: { type: "number" }, WorkOrderDetailID: { type: "number" }, ShortCode: { defaultValue: { PriceCodeID: 1436, ShortCode: "REF3" } }, Description: { type: "string" }, Quantity: { type: "number" } } } } }, pageable: true, height: 550, toolbar: ["create", "save", "cancel"], columns: [ { field: "ShortCode", title: "Price Code", editor: shortcodeDropDownEditor, width: "150px", template: "#=ShortCode.ShortCode#" }, { field: "Description", title: "Description", editable: "false" }, { field: "Quantity", title: "Quantity", width: "100px" }, { command: ["edit", "destroy"], width: "300px" }], editable: true, save: function(e) { if (e.values.hasOwnProperty('ShortCode')) { var test = e.model.set("Description", e.values.ShortCode.Description); var test = e.model.set("PriceCodeID", e.values.ShortCode.PriceCodeID); } }, saveChanges: function (e) { var client = $("#client") if (client.text === "") { e.preventDefault(); alert("Please select a Client before saving the Work Order."); } } }); $("#warehouse").kendoDropDownList({ dataTextField: "Name", dataValueField: "WarehouseID", dataSource: { valueTemplate: "#= Name#", template: '#= Name# <h3>#= Address1#, #= City #, #= Province#, #= Country#</h3>', transport: { read: { url: "http://localhost:53786/api/warehouse", dataType: "json" } }, schema: { model: { fields: { WarehouseID: { type: "number" }, Name: { type: "string" }, Address1: { type: "string" }, City: { type: "string" }, Province: { type: "string" }, Country: { type: "string" } } } } } }); }); function shortcodeDropDownEditor(container, options) { $('<input required data-text-field="ShortCode" data-value-field="PriceCodeID" data-bind="value:' + options.field + '"/>') .appendTo(container) .kendoDropDownList({ valuePrimitive: false, dataTextField: "ShortCode", dataSource: { transport: { read: { url: "http://localhost:53786/api/pricecodes/unique", dataType: "json" } } } }); }</script>One idea that I had is to send the ClientID from the AutoComplete and the date to hidden DIVs but then how do I retrieve the data into the Grid and send it to the server?


I have a scheduler with an Edit Template. The scheduler initialiser has a Resources section that is currently containing 3 hard coded items for the three Kendo drop downs I have in the template. When I run the code the drop downs are rendered but not bound to the resources. Eventually I will want the resources to be bound to database.
This is my initialiser
////initialise scheduler$("#scheduler").kendoScheduler({ date: Date.now(), timezone: "Europe/London", workDayStart: new Date("2013/1/1 08:00 AM"), workDayEnd: new Date("2013/1/1 8:00 PM"), dateHeaderTemplate: kendo.template("<strong>#=kendo.toString(date, 'ddd dd/M')#</strong>"), selectable: true, messages: { ariaSlotLabel: "Selected from {0:g} to {0:g}", showWorkDay: "Show core work hours" }, editable: { window: { title: "Work Request", width: "720px" }, template: $("#customEditorTemplate").html() }, height: 400, views: [ { type: "day", editable: { destroy: false } }, { type: "week", editable: { destroy: false }, eventHeight: 40 }, { type: "timeline", editable: { destroy: false }, eventHeight: 40 }, { type: "timelineWeek", selected: true, majorTick: 1440, minorTickCount: 1, editable: { destroy: false }, eventHeight: 40 }, { type: "agenda" }, { type: "month", editable: { destroy: false }, eventHeight: 40 } ], timezone: "Etc/UTC", dataSource: { type: "signalr", push: function (e) { var notification = $("#notification").data("kendoNotification"); notification.success(e.type); }, transport: { signalr: { hub: sHub, promise: sHubStart, server: { read: "read", create: "create", update: "update", destroy: "destroy" }, client: { read: "read", create: "create", update: "update", destroy: "destroy" } } }, schema: { model: { id: "wRequestID", fields: { wRequestId: { editable: false, from: "WRequestID", type: "number", defaultValue: 0 }, start: { from: "Start", type: "date", culture: "en-GB" }, end: { from: "End", type: "date", culture: "en-GB" }, diary: { from: "Diary", type: "object", defaultValue: "UIS" }, team: { from: "Team", type: "object" }, title: { from: "Title", type: "string", validation: { required: true } }, workManager: { from: "WorkManager", type: "object" }, assignee: { from: "Assignee", type: "object" }, changeRef: { from: "ChangeRef", type: "string", validation: { required: true } }, activity: { from: "Activity", type: "string", validation: { required: true } }, impactedServers: { from: "ImpactedServers", type: "string", validation: { required: true } }, impactedServices: { from: "ImpactedServices", type: "string", validation: { required: true } }, isBAU: { from: "IsBAU", type: "boolean", defaultValue: false }, projectRef: { from: "ProjectRef", type: "string", validation: { required: true } }, notes: { from: "Notes", type: "string" }, isOOH: { from: "IsOOH", type: "boolean", defaultValue: false }, isAllDay: { from: "IsAllDay", type: "boolean", defaultValue: false }, recurrenceRule: { from: "RecurrenceRule", type: "string" }, recurrenceId: { from: "RecurrenceID", type: "number" }, recurrenceException: { from: "RecurrenceException", type: "string" }, startTimezone: { from: "StartTimezone", type: "string" }, endTimezone: { from: "EndTimezone", type: "string" } } }, }, }, resources: [ { field: "team", dataSource: [ { text: "Team 1", value: "Team 1", color: "#f8a398" }, { text: "Team 2", value: "Team 2", color: "#51a0ed" }, { text: "Team 3", value: "Team 3", color: "#56ca85" } ], title: "Team" }, { field: "workManager", dataSource: [ { text: "Manager 1", value: "12345", color: "#f8a398" }, { text: "Manager 2", value: "23456", color: "#51a0ed" }, { text: "Manager 3", value: "34567", color: "#56ca85" } ], title: "Work Manager", }, { field: "assignee", dataSource: [ { text: "Alex", value: "12345", color: "#f8a398" }, { text: "Bob", value: "23456", color: "#51a0ed" }, { text: "Charlie", value: "34567", color: "#56ca85" } ], title: "Assigned To" } ]});and this is my Edit template...
<script id="customEditorTemplate" type="text/x-kendo-template"> <div class="container-fluid"> <div class="editor-row form-group-sm"> <div class="col-sm-1"> <label for="wRequestID">ID</label> <input type="text" class="form-control" id="wRequestID" name="wRequestID" readonly data-bind="value:wRequestID"> </div> <div class="col-sm-4"> <label for="diary">Diary</label> <input type="text" class="form-control" id="diary" name="diary" readonly data-bind="value:diary" value="UIS"> </div> <div class="col-sm-5 form-group-sm"> <label for="team">Team</label> <select id="team" data-bind="value:team" data-role="dropdownlist" data-value-field="value" data-text-field="text"> <option value="UIS Solaris">UIS Solaris</option> <option value="UIS Unix1">UIS Unix1</option> <option value="UIS Worthing">UIS Worthing</option> </select> </div> </div> <div class="editor-row form-group-sm"> <div class="col-sm-10"> <label for="title">Title</label> <input type="text" class="form-control" id="title" name="title" required="required" data-bind="value:title"> </div> </div> <div class="editor-row form-group-sm"> <div class="col-sm-5"> <label for="start">Start</label> <input type="text" data-role="datetimepicker" data-interval="15" data-type="date" data-bind="value:start,invisible:isAllDay" name="start"/> <input type="text" data-type="date" data-role="datepicker" data-bind="value:start,visible:isAllDay" name="start" /> <span data-bind="text: startTimezone"></span> <span data-for="start" class="k-invalid-msg" style="display: none;"></span> </div> <div class="col-sm-5"> <label for="end">End</label> <input type="text" data-type="date" data-role="datetimepicker" data-bind="value:end,invisible:isAllDay" name="end" data-datecompare-msg="End date should be greater than or equal to the start date" /> <input type="text" data-type="date" data-role="datepicker" data-bind="value:end,visible:isAllDay" name="end" data-datecompare-msg="End date should be greater than or equal to the start date" /> <span data-bind="text: endTimezone"></span> <span data-bind="text: startTimezone, invisible: endTimezone"></span> <span data-for="end" class="k-invalid-msg" style="display: none;"></span> </div> </div> <div class="editor-row form-group-sm"> <div class="col-sm-3"> <label for="isAllDay"><input type="checkbox" id="isAllDay" name="isAllDay" data-type="boolean" data-bind="checked:isAllDay"> Anytime</label> </div> <div class="col-sm-4"> <label for="isOOH"><input type="checkbox" id="isOOH" name="isOOH" data-type="boolean" data-bind="checked:isOOH"> OOH</label> </div> <div class="col-sm-3"> <label for="isBAU"><input type="checkbox" id="isBAU" name="isBAU" data-type="boolean" data-bind="checked:isBAU"> BAU</label> </div> </div> <div class="editor-row form-group-sm"> <div class="col-sm-5"> <label for="changeRef">Change Reference</label> <input type="text" class="form-control" id="changeRef" name="changeRef" required="required" data-bind="value:changeRef"> </div> <div class="col-sm-5"> <label for="projectRef">Project Reference</label> <input type="text" class="form-control" id="projectRef" name="projectRef" required="required" data-bind="value:projectRef"> </div> </div> <div class="editor-row form-group-sm"> <div class="col-sm-5"> <label for="workManager">Work Manager</label> <select id="workManager" name="workManager" data-bind="value:workManager" data-role="dropdownlist" data-value-field="value" data-text-field="text"> <option value="FZS78T">Manager 1</option> <option value="FZS89M">Manager 2</option> <option value="FZS98S">Manager 3</option> </select> </div> <div class="col-sm-5"> <label for="assignee">Assignee(s)</label> <select id="assignee" name="assignee" class="form-control" date-bind="value:assignee" data-role="dropdownlist" data-value-field="value" data-text-field="text"> <option value="FZS78T">Alex</option> <option value="FZS89M">Bob</option> <option value="FZS98S">Charles</option> </select> </div> </div> <div class="editor-row form-group-sm"> <div class="col-sm-5"> <label for="impactedServers">Impacted Servers</label> <input type="text" class="form-control" id="impactedServers" name="impactedServers" required="required" data-bind="value:impactedServers"> </div> <div class="col-sm-5"> <label for="impactedServices">ImpactedServices</label> <input type="text" class="form-control" id="impactedServices" name="impactedServices" required="required" data-bind="value:impactedServices"> </div> </div> <div class="editor-row form-group-sm"> <div class="col-sm-5"> <label for="activity">Activity</label> <textarea id="activity" name="activity" class="form-control" required="required" data-bind="value:activity"></textarea> </div> <div class="col-sm-5 form-group-sm"> <label for="notes">Notes</label> <textarea id="notes" name="notes" class="form-control" data-bind="value:notes"></textarea> </div> </div> <div class="editor-row form-group-sm"> <div class="col-sm-10"> <label for="recurrenceRule">Repeat</label> <div data-bind="value:recurrenceRule" name="recurrenceRule" data-role="recurrenceeditor"></div> </div> </div> </div> </script>
I have a C# / ASP.NET web application using Kendo web UI controls and Razor Views. Depending on the user's selection of one drop down ("ddlModelProperty"), it needs to enable or disable other dropdowns ("ddlSomeOtherModelProperty").
In my View file, I have a DropDownList defined like so:
@(Html.Kendo().DropDownListFor(m => m.ModelProperty).HtmlAttributes(new { id = "ddlModelProperty", @class = "k-dropdown-width-30", @tabIndex = "1", style = "width:60px", onchange = "OnChangeModelProperty(this);" }).BindTo(ViewBag.ZeroToOne).OptionLabel(" "))
@(Html.Kendo().DropDownListFor(m => m.SomeOtherModelProperty).HtmlAttributes(new { id = "ddlSomeOtherModelProperty", @class = "k-dropdown-width-30", @tabIndex = "1", style = "width:60px" }).BindTo(ViewBag.ZeroToThree).OptionLabel(" "))
In the controller, I have a method that returns the ViewResult. In this method, the ViewBag is populated like so:
ViewBag.ZeroToOne = FillDropDownValues(dtData, "ZeroToOne", "Notes", "Item");ViewBag.ZeroToThree = FillDropDownValues(dtData, "ZeroToThree", "Notes", "Item");
The FillDropDownValues method returns a List<System.Web.Mvc.SelectListItem> object containing the values to be displayed in the drop down.
The OnChangeModelProperty(this) method referenced in the onchange HtmlAttribute for ddlModelProperty performs the following:
var cmbVal = $("#" + cmb.id).val(); var enabled = (cmbVal != "0"); if (!enabled) $("#ddlSomeOtherModelProperty").kendoDropDownList({ index: 0 }); $("#ddlSomeOtherModelProperty").kendoDropDownList({ enable: enabled});
The problem is this:
My page loads, all drop downs populate and are able to be interacted with as expected. If I select "0" for ddlModelProperty, it disables ddlSomeOtherModelProperty as I expect it to. Then I change ddlModelProperty to a different value. This causes ddlSomeOtherModelProperty to be re-enabled, however when I click the Arrow to expand the DropDown menu nothing appears.
This leads me to believe 1 of 2 things is happening:
Either the DataSource is somehow being wiped out and the animation plays-- it just has nothing to display, or simply the animation is broken and isn't displaying at all.
What am I doing incorrectly?
Hi,
I have fileObjects and it has properties (name, extension, size, filepath). I understand name, extension and size are the reserved keywords that can be used in template code. However, i need the filepath (additional parameter) to be passed and used in template code.
So that when user click on the hyperlink, it will call the download function with two parameter (path and name). File path is mandatory because each file is stored in respective unique id (folder name) folder.
<% List<FileModel> files = ViewBag.files; %>var fileObjects = <%: Html.Raw(Json.Encode(files)) %>$("#upload-file").kendoUpload({ async: { saveUrl: "<%: Url.Action("UploadFile", ViewBag.Controller, new { topicId = Model.Id }) %>", removeUrl: "<%: Url.Action("RemoveFile", ViewBag.Controller, new { topicId = Model.Id }) %>", autoUpload: true }, template: "<span class='k-progress' style='width: 100%;'></span>" + "<span class='k-icon k-i-doc'></span>" + "<span class='k-filename' title='#=name#'><a href='\\#' onclick='downloadFile(\"#=name#\")'>#=name#</a></span>" + "<strong class='k-upload-status'>" + "<button type='button' class='k-button k-button-bare k-upload-action'>" + "<span class='k-icon k-i-close k-delete' title='Remove'></span>" + "</button>" + "</strong>", files: fileObjects, success: onSuccess, error: onError, upload: onUpload});
Thanks.
Regards,
Yap Hui Hong