or
<divclass="k-edit-label"><labelfor="ColName">Site</label></div><inputname="ColName"data-source="ColNameDataSource"data-text-field="colName"data-value-field="dartSiteName"data-bind="value:ColName"data-role="dropdownlist"/>
$.ajax({
type: "POST",
dataType: "json",
data: unwindDataToPostObj,
url: direction
})
.done(function (response) {
var grid = $("#gridAssoc").data("kendoGrid");
grid.dataSource.data(response);
grid.refresh();
})
.fail(function (jqXHR) {
console.log("error");
});
// ** Grid widget $("#gridAssoc").kendoGrid({ dataSource: CFDUnwind._assocTradesDataSource, navigatable: true, selectable: "single", height: 300, resizable: true, sortable: { mode: "single", allowUnsort: false }, columns: [ { field: "Strategy", title: "Strategy", width: 60 }, { field: "ImagineSNum", title: "ImagineSNum", width: 50 }, { field: "TradeDate", title: "Trade Date", width: 48, template: '#= kendo.toString(TradeDate,"MM/dd/yyyy") #' }, { field: "SetlDate", title: "Settle Date", width: 48, template: '#= kendo.toString(SetlDate,"MM/dd/yyyy") #' },...etc....
<div id="grid" data-role="grid" data-bind="source: tasks" data-columns='[{ "field": "taskId", "width": "150px", "title": "Id" }, ... ]' data-pageable='{ "pageSize": 10 }' data-groupable='[{ "field" : "completionStatusDescription", "aggregates": [{"field": "taskId", "aggregate": "count"}] }]' > </div>
@Html.Kendo().Grid(Model).Name("GridLocations").Columns(columns => { columns.Bound(l => l.Name).Title("Name"); columns.Command(command => { command.Edit().Text("Edit"); command.Destroy().Text("Delete"); }).HeaderTemplate("Manage"); }).ToolBar(toolbar => toolbar.Create().Text("Create")).DataSource(dataSource => dataSource .Server() .Model(model => model.Id(l => l.Id)) // Configure CRUD --> .Create(create => create.Action("Create", "Locations")) .Read(read => read.Action("Index", "Locations")) .Update(update => update.Action("Update", "Locations")) .Destroy(destroy => destroy.Action("Delete", "Locations")) // <-- Configure CRUD ).Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("EditLocations")){ "results": [{ "title": "My entry", "description: "My description"},{ "title": "Another entry", "description: "Another description"},]}