Skip to content

30 v_srs_table

Props

  • tablecss - cusotm table style default xd-white
  • table
  • api
  • infiniteScroll - true / for modal must be false

Events

  • @reload-event - reload table
  • @clipboard-event - this.clipboard_items;
  • '@enter-event'

todo

Przykład w kontekście SRS

JavaScript
Vue.component("v_order", {
  template: `

<div class="xd-responsive">
 <v_srs_table  :table="getItems" @reload-event="fetchData"  :api="api"></v_srs_table> 
</div>

  `
  props: ['table', 'api'],
  data: function () {
    return {
    },
    methods:{},
  computed: {
  getItems: function() {
      var itable = this.api.tables.findIndex(function (x) {
        return x.name === 'items'; 
      });

      if (itable === -1) 
        return {};

      return  this.api.tables[itable];
    },
  }
  });

Custom table

HTML
1
2
3
<div class="xd-responsive">
  <v_srs_table v-if="true" :table="getTable('view')" @reload-event="fetchData" tablecss="xd-small" :api="apidata"></v_srs_table>
</div>
JavaScript
  data: function () {
    return {
         apidata:{
        success:false,
        tables:[]
      },
    },
methods: {
 getTable: function getTable(tableName) {
      var itable = this.apidata.tables.findIndex(function (x) {
        return x.name === tableName; 
      });
      if (itable === -1) {
        return undefined;
      }
      return  this.apidata.tables[itable];
    },
     fetchData: function () {


     this.axget('/api/srs/310-nivea/api?imskampania_uuid=' + this.$route.query.id, null).then((response) => {
         this.apidata= response.data ;
        });
     }
    },
      mounted: function () {
          this.fetchData();
      }