I have the DevExpress component wrapped with an Aurelia customElement which works fine. I’m trying to navigate when the row is clicked. The dx component configuration lets you set a handler function for “onRowClick”. This also works, I get the data item in question. The issue is that this handler function is an isolated scope to the control, and I need to use this.router.navigateToRoute from the parent. I’m new to both Aurelia and DevExpress and I’m out of ideas on this. Using location.assign works, but it does a full page reload, so that’s not ideal.
If anyone can point me in a general direction I would appreciate the help.
attached() {
configureTheComponent({
rowClick: (all, the, data) => this.element.dispatchEvent(new CustomEvent('rowclicked', {
detail: { all, the, data } // you can use this to pass data upwards to your app view model
});
});
}
Thank you! You got me thinking differently about it and I figured out how to accomplish what I needed. Instead of setting the DexExpress component config’s onRowClick to a method on the parent, I have it publishing an event using the EventAggregator.
So it now looks something like this (left out some details for simplicity):