{"action":"created","issue":{"url":"https://api.github.com/repos/matfish2/vue-tables-2/issues/3","repository_url":"https://api.github.com/repos/matfish2/vue-tables-2","labels_url":"https://api.github.com/repos/matfish2/vue-tables-2/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/matfish2/vue-tables-2/issues/3/comments","events_url":"https://api.github.com/repos/matfish2/vue-tables-2/issues/3/events","html_url":"https://github.com/matfish2/vue-tables-2/issues/3","id":181829102,"number":3,"title":"Bus is not listening to event?","user":{"login":"forddyce","id":6212875,"avatar_url":"https://avatars.githubusercontent.com/u/6212875?v=3","gravatar_id":"","url":"https://api.github.com/users/forddyce","html_url":"https://github.com/forddyce","followers_url":"https://api.github.com/users/forddyce/followers","following_url":"https://api.github.com/users/forddyce/following{/other_user}","gists_url":"https://api.github.com/users/forddyce/gists{/gist_id}","starred_url":"https://api.github.com/users/forddyce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forddyce/subscriptions","organizations_url":"https://api.github.com/users/forddyce/orgs","repos_url":"https://api.github.com/users/forddyce/repos","events_url":"https://api.github.com/users/forddyce/events{/privacy}","received_events_url":"https://api.github.com/users/forddyce/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/matfish2/vue-tables-2/labels/daterangepicker","name":"daterangepicker","color":"0052cc"},{"url":"https://api.github.com/repos/matfish2/vue-tables-2/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-10-08T14:30:29Z","updated_at":"2016-10-08T18:14:16Z","closed_at":"2016-10-08T15:38:42Z","body":"- Vue.js version: 2.0.1\r\n- consumed using: browserify\r\n- issue:\r\n\r\nTrying to convert date string to moment using server side tables. console.log('test') does not run, do I have to import. Checked the `bus` value and it appears the $children is an empty array so I'm guessing the bus is not linked to the table. How do you listen to the event properly?\r\n\r\n- relevant code:\r\nthe html:\r\n`<v-server-table url=\"/items\" :columns=\"columns\" :options=\"options\" ref=\"listTable\"></v-server-table>`\r\n\r\nthe js:\r\n```\r\nimport moment from 'moment'\r\nimport bus from 'vue-tables-2/lib/bus'\r\nimport ShowLink from './../../components/button/showlink.vue'\r\nimport EditLink from './../../components/button/editlink.vue'\r\nimport DeleteLink from './../../components/button/deletelink.vue'\r\n\r\nvar tableColumns = ['name', 'stock', 'sku', 'price', 'created_at']\r\nvar options = {\r\n  pagination: {\r\n    dropdown: true,\r\n    chunk: 10\r\n  },\r\n  filterByColumn: true,\r\n  dateColumns: ['created_at'],\r\n  toMomentFormat: true,\r\n  texts: {\r\n    limit: 'Records: '\r\n  },\r\n  datepickerOptions: {\r\n    showDropdowns: true\r\n  },\r\n  debounce: 1000,\r\n  headings: {\r\n    name: 'Nama',\r\n    stock: 'Stok',\r\n    sku: 'SKU',\r\n    price: 'Harga',\r\n    created_at: 'Tanggal',\r\n    action: 'Actions'\r\n  },\r\n  templates: {\r\n    action: function (h, row) {\r\n      return <div class=\"btn-group\">\r\n        <show-link id={row.id} module=\"item\"></show-link>\r\n        <edit-link id={row.id} module=\"item\"></edit-link>\r\n        <delete-link id={row.id} module=\"item\" table={this.$refs.listTable}></delete-link>\r\n      </div>\r\n    }\r\n  },\r\n  customFilters: [\r\n    {\r\n      name: 'formatDate',\r\n      callback: function (row) {\r\n        console.log(row.created_at)\r\n        var value = row.created_at\r\n        if (value == null) return ''\r\n        var fmt = (typeof fmt === 'undefined') ? 'D MMM YYYY' : fmt\r\n        return moment(value, 'YYYY-MM-DD').format(fmt)\r\n      }\r\n    }\r\n  ]\r\n}\r\n\r\nexport default {\r\n  name: 'ItemList',\r\n  data: function () {\r\n    return {\r\n      elink: '#',\r\n      options: options,\r\n      columns: tableColumns\r\n    }\r\n  },\r\n  components: {\r\n    ShowLink: ShowLink,\r\n    EditLink: EditLink,\r\n    DeleteLink: DeleteLink\r\n  },\r\n  mounted () {\r\n    document.title = 'List Item - PT. Sukses Mandiri'\r\n  },\r\n  created () {\r\n    this.$on('id-selected', function (e) {\r\n      this.elink = '/item/edit/' + e\r\n    })\r\n\r\n    bus.$on('vue-tables.loaded', function () {\r\n      console.log('test')\r\n      bus.$emit('vue-tables.filter::formatDate')\r\n    })\r\n  }\r\n}\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/matfish2/vue-tables-2/issues/comments/252439717","html_url":"https://github.com/matfish2/vue-tables-2/issues/3#issuecomment-252439717","issue_url":"https://api.github.com/repos/matfish2/vue-tables-2/issues/3","id":252439717,"user":{"login":"forddyce","id":6212875,"avatar_url":"https://avatars.githubusercontent.com/u/6212875?v=3","gravatar_id":"","url":"https://api.github.com/users/forddyce","html_url":"https://github.com/forddyce","followers_url":"https://api.github.com/users/forddyce/followers","following_url":"https://api.github.com/users/forddyce/following{/other_user}","gists_url":"https://api.github.com/users/forddyce/gists{/gist_id}","starred_url":"https://api.github.com/users/forddyce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forddyce/subscriptions","organizations_url":"https://api.github.com/users/forddyce/orgs","repos_url":"https://api.github.com/users/forddyce/repos","events_url":"https://api.github.com/users/forddyce/events{/privacy}","received_events_url":"https://api.github.com/users/forddyce/received_events","type":"User","site_admin":false},"created_at":"2016-10-08T18:14:16Z","updated_at":"2016-10-08T18:14:16Z","body":"Still not working (clicking the filter button does not work), this is my entire entry point (index.js):\r\n```\r\n\r\nwindow.$ = window.jQuery = require('jquery')\r\nwindow.moment = require('moment')\r\nrequire('bootstrap')\r\nrequire('daterangepicker')\r\n\r\nimport Vue from 'vue'\r\nimport VueResource from 'vue-resource'\r\nimport VueRouter from 'vue-router'\r\nimport VuexRouterSync from 'vuex-router-sync'\r\n// import VueTables from 'vue-tables-2'\r\n\r\nimport ExtendDisableButton from './utils/ExtendDisableButton'\r\nimport ExtendForm from './utils/ExtendForm'\r\n\r\nimport routes from './app/routes'\r\nimport store from './app/store'\r\n\r\nnew ExtendDisableButton() // eslint-disable-line no-new\r\nnew ExtendForm() // eslint-disable-line no-new\r\n\r\n$.ajaxSetup({ // TODO: need to remove this\r\n  crossDomain: false,\r\n  dataType: 'json',\r\n  cache: true,\r\n  async: false,\r\n  headers: {\r\n    'X-CSRF-Token': $('meta[name=\"_t\"]').attr('content')\r\n  }\r\n})\r\n\r\nVue.use(VueResource)\r\nVue.http.headers.common['X-CSRF-Token'] = $('meta[name=\"_t\"]').attr('content') // eslint-disable-line no-undef\r\nstore.dispatch('checkAuthentication')\r\n\r\nVue.use(VueRouter)\r\n\r\nexport const router = new VueRouter({\r\n  mode: 'history',\r\n  routes\r\n})\r\n\r\nrouter.beforeEach((to, from, next) => {\r\n  if (to.matched.some(m => m.meta.auth) && !store.state.auth.authenticated) {\r\n    next({\r\n      name: 'admin.login'\r\n    })\r\n  } else if (to.matched.some(m => m.meta.guest) && store.state.auth.authenticated) {\r\n    next({\r\n      name: 'admin.index'\r\n    })\r\n  } else {\r\n    next()\r\n  }\r\n})\r\n\r\nVuexRouterSync.sync(store, router)\r\nVue.router = router\r\n\r\nvar VueTables = require('vue-tables-2')\r\nVue.use(VueTables.server)\r\n\r\nimport * as App from './app/index.vue'\r\n\r\nnew Vue(App).$mount('#root')\r\n\r\n```"}}
{"actor":{"display_login":"forddyce"}}