Hi
I want to create a assessment report which a user creates and submit it (to DB, export to PDF, etc.) using WYSIWYG editor. I have templates/formats of the report in the form of several statements and want to create links/buttons to click which adds the text/lines in the editor to prepare the report.
Tried searching in the community and in docs but could not find a proper answer. Please advise.
I’m not sure what you mean. Is it that you have a bank of phrases, paragraphs etc. that you want displayed as buttons that, when clicked, insert to the cursor position in the text editor?
Use a textarea with Summernote enabled.
You could have a DB table that contains a set of statements, create a Server Connect query to retrieve them. Once retrieved, use a repeat to create a button for each - set the dynamic attribute of innertext to the statement. Then set the dynamic click event for the button to insert text (the repeat statement value) into the editor.
Tried the above steps. The buttons are generating but the dynamic click event to insert text is not working. Receiving below error in console.
TypeError: this.editor.insertText is not a function
at n.insertText (summernote.js:496)
at Object.data.<computed> (BaseComponent.js:475)
at parser.js:714
at parser.js:455
at Object.dmx.parse (parser.js:388)
at HTMLButtonElement.<anonymous> (on.js:9)
at HTMLButtonElement.n (appConnect.js:472)
at HTMLButtonElement.dispatch (jquery-3.3.1.slim.min.js:2)
at HTMLButtonElement.v.handle (jquery-3.3.1.slim.min.js:2)
I tried other dynamic events for summernote and getting similar error for each function.
I am working on NodeJS.
Several features of the Summernote editor were missing when it was initially added to Wappler, and I don’t think there has been any development since then. Some of these features were discussed here. It would certainly be useful if the missing features were added at some point.
I don’t think there is a way to do this in Wappler, at least at the moment (and at least as far as I know). This example might be a solution.
I’m not sure if there is a point where features like this become bugs to be reported, or if they are just features which have not been implemented, or perhaps forgotten about.