Advertisement
Guest User

Untitled

a guest
Apr 5th, 2016
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. Vue.use(VueTables.client, {
  2. compileTemplates: true,
  3. highlightMatches: true,
  4. dateFormat: "DD-MM-YY",
  5. /* skin: "table-compact",*/
  6. pagination: {
  7. dropdown:true,
  8. chunk:5
  9. },
  10. filterByColumn: true,
  11. texts: {
  12. filter: "Search:"
  13. },
  14. datepickerOptions: {
  15. showDropdowns: true
  16. },
  17.  
  18. });
  19.  
  20. new Vue({
  21. el: "#people",
  22. created: function(){
  23. this.$http.get('/api/footage')
  24. .then(function(response){
  25. this.tableData = response.data
  26. }.bind(this))
  27. },
  28.  
  29. methods: {
  30. deleteMe: function(id) {
  31. alert("Delete " + id);
  32. },
  33. },
  34. data: {
  35. options: {
  36. columns: ['created_at', 'name', 'profession', 'footage_date', 'type', 'link'],
  37. dateColumns: ['footage_date'],
  38. datepickerOptions : {ranges: {
  39. 'Today': [moment(), moment()],
  40. 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
  41. 'Last 7 Days': [moment().subtract(6, 'days'), moment()],
  42. 'Last 30 Days': [moment().subtract(29, 'days'), moment()],
  43. 'This Month': [moment().startOf('month'), moment().endOf('month')],
  44. 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  45. }},
  46. headings: {
  47. created_at: 'Added',
  48. name: 'Name',
  49. profession: 'Profesion',
  50. footage_date: 'Footage Date',
  51. type: 'Type',
  52. link: 'Link',
  53. },
  54. templates: {
  55. expand:"<a href=/footage/{id}><i class='fa fa-expand'></i></a>",
  56. },
  57. },
  58.  
  59.  
  60. tableData: [{/* id: "1",
  61. name: "Sidney Brakus",
  62.  
  63. footage_date: randomDate(new Date(1925, 0, 1), new Date(2012, 0, 1)) */}],
  64. }
  65. });
  66.  
  67. function randomDate(start, end) {
  68. return moment(start.getTime() + Math.random() * (end.getTime() - start.getTime()));
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement