Closed andersevenrud closed 3 years ago
By the scaffolding I was refering to the "UI Customization" step in the manuals.
Thanks for making changes, does this mean I need to use renderCustom
instead of render?
const callbackRender = ($content, dialogWindow, dialog) => {
$content.innerHTML = "Hello"
};
core.make('osjs/dialogs')
.create({buttons: ["button-1", "cancel"],
window: {
title,
dimension: {width: 400, height: 400}
}}, ()=>{
}, (button)=>{
alert(button)
})
.render(callbackRender);
I just tried with this, it doesn't seem to work.
Yes, renderCustom is the new method.
On Sun, Aug 1, 2021, 17:45 Wei Ouyang @.***> wrote:
Thanks for making changes, does this mean I need to use renderCustom instead of render?
const callbackRender = ($content, dialogWindow, dialog) => { $content.innerHTML = "Hello" }; core.make('osjs/dialogs') .create({buttons: ["button-1", "cancel"], window: { title, dimension: {width: 400, height: 400} }}, ()=>{
}, (button)=>{ alert(button) }) .render(callbackRender);
I just tried with this, it doesn't seem to work.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/os-js/osjs-dialogs/pull/12#issuecomment-890542308, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHODAK4FAMVYMHKI5JMMDT2VT3LANCNFSM5BLGZG2Q .
I had some issue with my setup, cannot make this branch work with my desktop, I will wait for your test.
Update @osjs/dialogs
and rebuild your client. Then you should be able to use this new method.
I've also updated the documentation: https://github.com/os-js/manual.os-js.org/commit/9283ee5606f47d759c0c1cb4545024cf9bcde5b1 (which is currently being deployed)
This allows to create custom dialogs without relying on Hyperapp to construct the intial UI with buttons in the custom dialog.
Right now to create a custom dialog with buttons, following https://manual.os-js.org/tutorial/dialog the
.render()
call needs to be set up with some scaffolding. I added.renderCustom()
that has the same signature, but gives you the buttons out of the box.