Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

189
Visualizações
Vue.js + Triggerring methods of the independent class does not work in html

I have the below class. The functions of the class are not assigned to the data property 'this.gridFilter' when instantiated. I am calling 'gridFilter.set' onclick of the list item which does not get triggered and I get the following error on the console 'Cannot read properties of undefined (reading '_withTask')' and nothing works. This happens only when I call the 'set' function from the instantiated object. How can I call the class functions from the Html file? Please help

class GridFilters
{

    constructor(grid)
    {
        this.grid = grid;
        this.filterError = false;
        this.isShow = false;
        this.currentFilter = '';
        this.filters = {};
    }

    async loadFilters()
    {
        const query = `?$select=*&$filter=mastertable eq ${window.parent.Xrm.Page.data.entity.getId().replace(/[{}]/g, "")}&$orderby=ice_name asc`;
        this.filters = await window.parent.Xrm.WebApi.retrieveMultipleRecords('filters', query);
        return this.filters;
    }

    async set()
    {
        const grid = this.grid;
        grid.$refs.overlay.classList.remove('customgrid-modal-hidden');
        grid.$refs.filter.classList.remove('customgrid-modal-hidden');
    }

}


export default {
 data() {
  return {
  gridFilter : {};
  };
 },
methods: {},
created () {
this.gridFilter = new GridFilters(this); 
 }
 };

//html

<li><a v-on:click="gridFilter.set"><img src="../Images/ICE.Filter.svg" title="Filter" /><span>Filter</span></a></li>
about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda