0
votes

I am using vue kendo grid but whenever i use a column template i need to go with html and jquery if there are any method call instead can i use vue template for the column just like row template?.

1

1 Answers

1
votes

Yes check this more informations in the forum post

Set a template to a column

<kendo-grid-column :template="itemTemplate"></kendo-grid-column>

Reference to vue file

import Template from "./Template.vue";
var itemTemplate = Vue.component(Template.name, Template);

and

export default {
  ...
  methods: {
    itemTemplate: function(e) {
      return {
        template: itemTemplate,
        templateArgs: e
      };
    }
  },

Example of a template

<template>
    <span>
        <a role='button' class='k-button k-button-icontext filter-clear' href='\\#' @click="buttonClick">
          <span class='k-icon k-i-filter-clear'></span>
          open
        </a>
    </span>
</template>

<script>
export default {
  name: "template1",
  methods: {
    buttonClick: function(e) {
      alert("Button click");
    }
  },
  data() {
    return {
      templateArgs: {}
    };
  }
};
</script>