Allow Trait API clients to override and use initlialize method of TraitView class
Hi @vrudikov I didn't get what do you suggest. Would you like to have some kind of init() method which acts as a callback after the initialization?
Read full answer below βQuestion
Current behaviour: When traits get added with TraitView.addType method they are extend TraitsViewer.itemView(which is TraitView). When TraitSelectView class extends TraitView it overrides initialize(o) method and calls TraitView.prototype.initialize.apply(this, arguments); to initialize parent class(as i understand). This allows TraitSelectView to override some initializing logic. For example override this.tmpl and use custom template for a trait For a custom trait with overridden initialize method there we gonna see an error: But with the following code everything works perfect and i can ove...
Answers (1)
Hi @vrudikov I didn't get what do you suggest. Would you like to have some kind of init() method which acts as a callback after the initialization?
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2405
Ckeditor is not initialized when replace trait text
why when i change the ckeditor trait text it is not initialized my trait <pre> domComps.addType('text',{ model: dModel.extend({ defaults: O...
Issue #3732
Comment component type do not support adding traits
i am working on a script that add a trait on all the component type , but the comment type do not have the prototype object. code
Issue #3309
TextNodes interfere when changing content on element
Version: 0.16.44 Hi @artf I have a custom block with a custom button component, which its content is similar to this one. <a data-gjs-type=...
Issue #2188
How to change tagName using traits.
Hello, I want to achieve this: When user clicks on a heading tag H1, H2, H3 ... I want a trait to appear (of a select / dropdown type) whic...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins βPremium plugins ship with support, regular updates, and production-ready features β save days of integration work.
Browse premium plugins βBrowse Plugin Categories
Jump directly to plugin category pages on the marketplace.