Skip to content
Discussion options

You must be logged in to vote

OK, so you get access to the component when creating the data type via the init method, simply storing the this reference when in the view's init function for use later worked for me.

var canvasElement;
editor.Components.addType('dataTable', {
		model: {
			defaults: {
				script,
				tagName: 'table',
				id: 'dataTable',
			}
		},
		view: {
			init() {
				console.log('Local hook: view.init');
				canvasElement = this;
				editor.Modal.open({
					title: 'Data Table', // string | HTMLElement
					content: 'Loading..', // string | HTMLElement
				});
				loadDataTable();
			},
			onRender() {
			
			},
		}
	});

And then when closing the modal, you can access via this:
canvasElement.mode…

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@craigfairhurst
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@artf
Comment options

artf Aug 8, 2023
Maintainer

@craigfairhurst8
Comment options

Answer selected by craigfairhurst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants