Skip to content

Instantly share code, notes, and snippets.

@hikalkan
Created January 17, 2017 12:37
Show Gist options
  • Save hikalkan/165ebabfd326dbcf11662bee25426697 to your computer and use it in GitHub Desktop.
Save hikalkan/165ebabfd326dbcf11662bee25426697 to your computer and use it in GitHub Desktop.
Kendo UI integration sample for ABP dynamic service proxies
$('#UsersGrid').kendoGrid({
editable: true,
columns: [{
field: 'userName',
title: app.l('UserName')
}, {
field: 'name',
title: app.l('Name')
}, {
field: 'surname',
title: app.l('Surname')
}, {
field: 'emailAddress',
title: app.l('EmailAddress')
}, {
field: 'isActive',
title: app.l('IsActive'),
template: '#= isActive ? "YES" : "NO" #'
}],
dataSource: new kendo.data.DataSource({
autoSync: true,
transport: {
read: function(options) {
abp.services.app.user.getUsers()
.done(function (result) {
options.success(result.items);
})
.fail(function(error) {
options.error(error);
});
},
update: function(options) {
abp.services.app.user.updateUser(options.data)
.done(function(result) {
options.success(null);
})
.fail(function(error) {
options.error(error);
});
}
},
schema: {
model: {
id: 'id',
fields: {
id: {
editable: false,
nullable: true
},
userName: {
editable: true
},
name: {
editable: true
},
surname: {
editable: true
},
emailAddress: {
editable: true
},
isActive: {
editable: false
}
}
}
}
})
});
@hikalkan
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment