DataviewJS - which is this.container.createEl
Docment?
#1654
-
Hi again, I did try to find the document or look up dataview project of this function,but I'm still not understand how it's work. Test:: A
``` dataviewjs
const {autoprop} = this.app.plugins.plugins["metaedit"].api;
const {update} = this.app.plugins.plugins["metaedit"].api;
const buttonMaker = () => {
const btn = this.container.createEl('button', {"text": "AutoPropTest"});
btn.addEventListener('click', async (evt) => {
evt.preventDefault();
let value = await autoprop("Test")
await update('Test',value,dv.current().file.path)
});
return btn;
}
buttonMaker();
``` when I click the button, metaedit will show you the prop and update metadata after you chose. I search HTML Element and find this: as my know, 'input' and 'select' can be use in this.container.createEl,that look similar with HTML element, Did I going in wrong way? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The documentation is here. It's not much but... So you can do something like:
(Note that for input buttons, |
Beta Was this translation helpful? Give feedback.
The documentation is here. It's not much but...
So you can do something like:
dv.container.createEl("input", { value:"Button text", type:"button", anyOtherProperty: "yourValue" });
(Note that for input buttons,
value
is equivalent totext
)