function HideColumn(gridId,numColumn) { $("#" + gridId + " th:eq(" + numColumn + ")").hide(); $("#" + gridId + " td:nth-child(" + (numColumn+1) + ")").hide(); } $(document).ready(function () { $("#grid").kendoGrid({ dataBound : function(e) { //RegisterGrid($("#grid").data("kendoGrid")); HideColumn("grid",0); }, (…)
Showing posts with label kendoui. Show all posts
Showing posts with label kendoui. Show all posts
Thursday, February 2, 2012
KendoUI : Hiding Columns
Here is a little snippet to hide columns on dataBound event
KendoUI : Row Selection
Here is an example which shows how to select a row and saving
a grid instance after creation.
Notice that we register the grid in 'dataBound' event, otherwise
we register an empty grid !!!
a grid instance after creation.
Notice that we register the grid in 'dataBound' event, otherwise
we register an empty grid !!!
var grid; function RegisterGrid(g) { grid = g; grid.select(grid.tbody.find(">tr").eq(3)); } $(document).ready(function () { var grid = $("#grid").kendoGrid({ dataBound : function(e) { RegisterGrid($("#grid").data("kendoGrid")); }, columns: [{ field: "id", title: "" }, { field: "Email", title: "Email" }], dataSource: { transport: { read: { type: "POST", url: "http://localhost/WebService.asmx/GetAdmin?name=Paul&age=12", data: [], contentType: "application/json; charset=utf-8", dataType: "json", async: true } }, schema: { data: "d", model: { fields: { id: { type: "number" }, Email: { type: "string" } } }, total : function (r) { } }, }, selectable: "row", navigatable: true, sortable: true, pageable: true, change: function (arg) { var selected = $.map(this.select(), function (item) { alert(item.cells[0].innerHTML); }); }, }); })
Tuesday, January 31, 2012
KendoUI Grid and WebServices
Here is a simple example on how to do :
$(document).ready(function () { $("#grid").kendoGrid({ columns: [ { field: "id", title: "ID" }, { field: "Email", title: "Email" }], dataSource: { transport: { read: { type : "POST", url : "http://localhost/WebService.asmx/GetAdmin", data : null, contentType : "application/json; charset=utf-8", dataType: "json", async: true } }, schema : { data: "d" } } }); });
Subscribe to:
Posts (Atom)