Meta Bind & JS Engine: Creating multiple buttons and using them inline within a JS Engine table #310
I-Pch
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there 😊 !
I am a fairly new user of Meta Bind and JS Engine and I've been exploring the features of both plugins over the past few weeks.
I have a very specific (and probably advanced 😅 ) use case in mind and for the final result of what I'm trying to build with Meta Bind & JS Engine, I wanted to possibly be able to create different notes in different folders by clicking on a Meta Button stored in the rows of a JS Engine generated table 🙈 ...
The big issue with that idea was that the buttons, while doing generally something similar, fundamentally needed to be different/unique (different
fileName
&folderPath
).Another issue was that, iirc, only inline codes work in
md
tables so I also needed to use inline buttons which would require, for each button, a different buttonid
I could reference ...All of this meant that I couldn't really use a manually created
Button Templates
and instead, as everything depends on the content of each row in the JS Engine table I ultimately want to create, well, I also needed to create the desired buttons "in place" within the JS Engine code block generating the table 😅 ...Thinking this could potentially help someone (or give some ideas, leads to follow), I thought I'd share how I got it all working 😊 ...
Method 1: JS Engine & Meta Bind's API
References
Resulting table
JS.Engine.-.MB.-.Table.and.buttons.mov
Some things to note though 😇 :
Note 01
in the folderMeta Bind/Note 01
on a very first click... and on a 2nd click, it'll create a note titledNote 01 1
still in the folderMeta Bind/Note 01
(following the same principle mentioned here )There's another way to get to the same result through a(See below 😊 )meta-bind-button
code block (I've got it working too, but I need to refactor what I wrote and didn't have the chance to get to it (yet) 😇)Method 2: Using JS Engine to generate
meta-bind-button
code blocksThe buttons here don't create new notes (I wanted to try something a bit different 😊 ) but they send a small notice...
The principle is the same though: Creating different/unique buttons and use them inline, in a JS Engine generated table.
Resulting table
JS.Engine.-.MB.CB.-.Table.and.buttons.mov
Another thing to note 😄 :
I am no JavaScript/Meta Bind/JS Engine expert 🙈 (but getting slowly better I think 😄 )... and while everything seem to work as expected from my side of the screen, if you spot any errors I could have made, please let me know, so I can:
Well, that's finally it 😄 !
Sorry for the length 🙈 ... and thank you for reading 🙌 !
Thank you so so very much to mProjectsCode for building such wonderful plugins 🙌 and also, for their patience, kindness and help as I'm learning how to use them !!!
Beta Was this translation helpful? Give feedback.
All reactions