Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var dataSource = new kendo.data.DataSource({
- transport: {
- read: {
- url: 'api/users'
- },
- destroy: {
- url: 'users/delete',
- type: 'post'
- },
- update: {
- url: 'api/users',
- type: 'post'
- },
- create: {
- url: 'api/users',
- type: 'post'
- }
- },
- batch: true,
- pageSize: 5,
- schema: {
- model: {
- _id: "UserID",
- fields: {
- url: {type : "string"},
- username: {type: "string", validation: { required: true } },
- email: {type: "string", validation: { required: true } },
- roles: {type: "string"},
- password: {type: "string"}
- }
- }
- }
- });
- vm.gridOptions = {
- columns: [
- {
- template: "<img style='width: 60px; border-radius: 30%' src=#:data.pictureUrl#>",
- field: "pictureUrl",
- title: "Picture",
- width: 100
- },
- {field: "username", title: 'Username'},
- {field: "email", title: 'Email'},
- {field: 'roles', title: 'Role'},
- {field: 'password', title: 'Password'},
- { command: ["edit", "destroy"], title: " ", width: "250px" }
- ],
- editable: "inline",
- toolbar: ["create"],
- pageable: true,
- sortable: true,
- dataSource: dataSource
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement