Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

188
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!