Fire events

Because pagehelper bundled with Alpine.js so it’s easy to fire or receive events on Alpine.js managed elements in the page. However Pagehelper support firing events for 3 helper attributes.

Add ph-fire-event="eventname:target" to these HTML elements will fire the event after the client receive the response from the server side.

System wide events

Two events will be fired: selector-changed, row-deleted.

const ids = item.params.ids as { name: string, id: number }[]
window.dispatchEvent(new CustomEvent('row-deleted', { detail: { ids } }))
window.dispatchEvent(new CustomEvent('selector-changed',
	{
		detail: {
			obname: this.obname,
			selected: this.getSelectedIds()
		}
	}));

Back to top

Discord, QQ group:418474680