Hello,
I have a grid that with several tiles, and when a tile is clicked, it fetches data and navigates to a new screen. During the fetching, I want to display a loading spinner and hide the grid. I am trying to use signals so that the grid tile can communicate to the grid component when enter is clicked. I have followed the documentation on signals, and I am doing everything according to the docs, but the signal is not being fired to the grid component, nor the parent component as a whole.
GridTile.js
export default class GridTile extends Lightning.Component {
...
_handleEnter() {
this.signal('enterClicked');
fetchSomeData()
}
}
PageWithGrid.js
export default class PageWithGrid extends Lightning.Component {
static _template() {
return {
Grid: {
...
type: Grid,
signals: {
enterClicked: true,
},
},
...
}
}
enterClicked() {
// do something
}
_setup() {
...
this.tag('Grid').add(this.loadedItems) // array of Grid Tiles
}
}
Let me know if there is something I’m doing wrong and how to do it right, or if this is in fact correct.
Thanks!