Hello guys,
i am working on Asp.Net MVC Project. i have to creted and initialize kendo grid from jquery file. the function that create kendo grid in jquery is as below
- function initializeGrid(gridName, url, onSelectFunction) {
- onSelectFunction = onSelectFunction || null;
- var transport = {
- read: {
- //type: "POST",
- url: url,
- dataType: "json"
- }
- };
- var dataSource = new kendo.data.DataSource({
- transport: transport,
- pageSize: 30,
- schema: {
- model: {
- id: "ClientID",
- fields: {
- ClientID: { type: "number", editable: false },
- ClientName: { type: "string", validation: { required: true } }
- }
- }
- }
- });
- $("#" + gridName).kendoGrid({
- dataSource: dataSource,
- scrollable: true,
- height: 550,
- selectable: "multiple cell",
- filterable: true,
- columns: [
- {
- field: "ClientID",filterable: false,width:100
- },
- { Template: (") },
- {
- field: "ClientName",title: "Client Name",width: 200
- }
- ]
- });
- $("#" + gridName).data("kendoGrid").bind();
- //$("#" + gridName).attr("data-val-number", "Invalid input.");
- }
- initializeGrid("client", "/Clients/GetDataForCombo", null);
Regards,
Savan Parmar
Manikandan MurugesanPosted Jul 10, 2017, 8:43 PM