UI controls for ASP.NET AJAX, MVC, WPF,Silverlight, Windows 8 and Windows Phone
Cross-platform Mobile Development Toolwith cloud-based architecture
Everything you need to build sites andmobile apps with JavaScript and HTML5
One easy tool for Functional, Performance,Load and Mobile software testing
Everything for your online business - contentmanagement, ecommerce, emarketing
Simple and intuitive project managementand collaboration software
17 Jun 2012 (Link to this post)
$("#grid").kendoGrid({
dataSource: dataSource,
pageable: true,
height: 340,
toolbar: ["create"],
columns:
[{"field":"firstName","title":"First name"},{"field":"nickName","title":"Nick Name","template":"#= kendo.toString(nickName,'MM/dd/yyyy') #"},{"field":"lastName","width":"150px","editor":lastNameEditor},{"command":"destroy","title":" ","width":"110px"}] ,
editable: true
});
var dataSource = new kendo.data.DataSource({
parameterMap: function(options, operation) {
//alert(operation);
return kendo.stringify(options);
if (operation !== "read" && options.models) {
return {models: kendo.stringify(options.models)};
}
},
transport: {
read: {
url: "http://localhost/EditableCrudGrid/gridtest.php?table=gridTest&mode=Read",
dataType: "json",
type: "POST",
data: {"SQLCMD":"SELECT * FROM gridTest","Table":["firstName","nickName","lastName"],"PrimaryKey":"peopleID"}
update: {
url: "http://localhost/EditableCrudGrid/gridtest.php?table=gridTest&mode=Update",
type: "POST"
destroy: {
url: "http://localhost/EditableCrudGrid/gridtest.php?table=gridTest&mode=Destroy",
create: {
url: "http://localhost/EditableCrudGrid/gridtest.php?table=gridTest&mode=Create",
data: {
req: ["firstName","nickName","lastName"] }
// determines if changes will be send to the server individually or as batch
batch: false,
//...
pageSize: 30,
data: blankData,
autoSync: true,
schema: {
model: {
id: "peopleID",
fields:
{"peopleID":{"editable":false,"nullable":true},"firstName":{"type":"string","validation":{"required":true},"nullable":false,"defaultValue":""},"nickName":{"type":"date","validation":{"required":true},"nullable":false,"parse":function(value) { return kendo.toString(value) }},"lastName":{"type":"string","validation":{"required":true},"nullable":false}} }
, parse: function (data) {
// alert(data);
return data;
20 Jun 2012 (Link to this post)
Copyright © 2011 - 2013 Telerik Inc. All rights reserved.