or
$("#color").kendoDropDownList({ dataTextField: "text", dataValueField: "value", dataSource: [ { text: "Black", value: 1 }, { text: "Orange", value: 2 }, { text: "Grey", value: 3 } ], index: 0, change: onChange});01.@section scripts02.{03.<script>04. $(function () {05. var hubUrl = "/signalr/hubs";06. var connection = $.hubConnection(hubUrl, { useDefaultPath: false });07. var hub = connection.createHubProxy("submissionHub");08. var hubStart = connection.start();09. 10. $("#notification").kendoNotification({11. width: "100%",12. position: {13. top: 0,14. left: 015. }16. });17. $("#grid").kendoGrid({18. editable: true,19. sortable: true,20. dataSource: {21. type: "signalr",22. autoSync: true,23. // Handle the push event to display notifications when push updates arrive24. push: function (e) {25. var popupNotification = $("#popupNotification").data("kendoNotification");26. popupNotification.show(e.type, "success");27. },28. schema: {29. model: {30. id: "SubmissionId",31. fields: {32. "SubmissionId": { editable: false },33. "FirstName": { type: "text" }34. }35. }36. },37. sort: [{ field: "SubmissionId", dir: "desc" }],38. transport: {39. signalr: {40. promise: hubStart,41. hub: hub,42. server: {43. read: "read",44. update: "update",45. destroy: "destroy",46. create: "create"47. },48. client: {49. read: "read",50. update: "update",51. destroy: "destroy",52. create: "create"53. }54. }55. }56. }57. });58. });59. 60. 61.</script> 62.}63. 64.<div id="grid" data-role="grid" style="height: 200px">65.</div>01.using Microsoft.AspNet.SignalR;02.using Test_Project.Models;03. 04.namespace Test_Project.Hubs05.{06. public class SubmissionHub : Hub07. {08. public void Read()09. {10. Clients.All.Read(Database.Submissions.ToArray());11. }12. 13. public void Update(Submission submission)14. {15. Clients.All.Update(submission);16. }17. 18. public void Destroy(Submission submission)19. {20. Clients.All.Destroy(submission);21. }22. 23. public void Create()24. {25. Clients.All.Create(new Submission());26. }27. }28.} <a href="#" id="ic_open" class="tooltip2" title="Abrir"> <span title=""> <img class="toolbar-icons" src="../../Images/open.png"/> </span> </a>... <div id="datagrid"> @(Html.Kendo().Grid(Model) .Name("datagrid_Concessoes") .Columns(columns => { columns.Bound(c => c.Id).Width(70); columns.Bound(c => c.Code); columns.Bound(c => c.Description); columns.Bound(c => c.CreationDate); columns.Bound(c => c.CreationUser); }) .HtmlAttributes(new { style = "height: 534px;" }) .Scrollable() .Sortable() .Selectable() .Pageable(pageable => pageable .Refresh(true) .ButtonCount(5)) .DataSource(dataSource => dataSource .Ajax() .PageSize(15) .Read(read => read.Action("GetConcessoes", "MasterData")) ) ) </div><script type="text/javascript">$(function () { $('.tooltip2').click(function () { var id = this.id; $.get('@Url.Content("GetPartialView")', { "id": id }, function (data) { $('#div-for-partial').html(data); }); }); });</script>.Columns(columns =>{ columns.Bound(b => b.Field); columns.Bound(b => b.OldValue); columns.Bound(b => b.NewValue); columns.Bound(b => b.DateImported).Format("{0:dd-MMM-yyyy}"); columns.Bound(b => b.BuildingChangeValidationStatusType).ClientTemplate("#=BuildingChangeValidationStatusType.Value#").Width(250); columns.Command(command => command.Custom("Update").Click("updateValidation")); columns.Command(command => { command.Edit(); }).Width(172);})@model Rep.Models.BuildingChangeValidationViewModel@(Html.Kendo().DropDownList() .Name("BuildingChangeValidationStatusType") // Name of the widget should be the same as the name of the property .DataValueField("Id") .DataTextField("Value") .BindTo((System.Collections.IEnumerable)Model.BuildingChangeValidationStatuses)).BindTo((System.Collections.IEnumerable)Model.BuildingChangeValidationStatuses)){ "odata.metadata":"http://localhost:40946/odata/$metadata#AlbumThumbnail","odata.count":"2","value":[ { "ImageId":29,"Title":null }, { "ImageId":30,"Title":null } ]}var thumbnailSource = new kendo.data.DataSource({ type: "odata", transport: { read: { url: "/odata/AlbumThumbnail/", dataType: "json", data: { id: 31 } }, schema: { data: function (data) { return data.value; }, total: function (data) { return data["odata.count"]; }, model: { fields: { ImageId: { type: "number" } } } } }});$(window).load(function () { thumbnailSource.read();});function anonymous(d) { return d.d.__count}