Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Account = new Schema({
- username: String,
- names: {type:String,default:""},
- lastnames: {type:String,default:""},
- password: String,
- email: String,
- phone: String,
- suspended: {type: Boolean, default: false},
- type: { type: String, enum: TIPOS_USUARIO, default: 'dev' },
- lastlogin: 'moment'
- });
- $(document).ready(function() {
- var table = $('#example').DataTable( {
- "ajax": "/adminpanel/webapi/userlist",
- "columns": [
- { "data": "username" },
- { "data": "names" },
- { "data": "lastnames" },
- { "data": "phone" },
- { "data": "email" },
- { "data": "suspended" },
- { "defaultContent": "<button>Delete!</button>"},
- ],
- });
- $('#example tbody').on( 'click', 'button', function () {
- alert( "You are about to delete an user");
- var data = table.row( $(this).parents('tr') ).data();
- table.row('.selected').remove().draw( true );
- });
- });
Add Comment
Please, Sign In to add comment