Question

update query limit in custom visualization

  • 22 August 2022
  • 0 replies
  • 16 views

Hi,

I am writing a simple custom vis that updates the query limit upon the user clicking a button.

Upon clicking the button, the script calls this.trigger("limit", [10]); but nothing happens next. I was expecting a rerender with a new dataset.

Am I missing something? Am I supposed to maybe call a certain method to force a rerender?

Thanks

here is my custom vis code for reference:


let updateLimit;

looker.plugins.visualizations.add({
id: 'customVis',
label: 'my custom vis',

create: function (element, config) {
let container = element.appendChild(document.createElement('div'));
container.className = 'myCutsomVis';
this._textElement = container.appendChild(document.createElement('div'));
},

update: function (data, element, config, queryResponse, details) {
this._textElement.innerHTML = `
... some code displaying the data ..

<button id='loadMore'>See more stuff</button>
`;


updateLimit = ()=>{
this.trigger("limit", [10]);
}

}
});


$("body").on("click", "#loadMore", () => updateLimit());


 


This topic has been closed for comments