-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get variables from custom buttons on Windows #1592
Comments
|
Hi Olton, thank you for the extremely quick response! Not sure how i would use this though when creating a window? I have used the tutorial and have a set of custom buttons as a global variable. Not sure how I can use your example though? I have tried creating a document ready function: And the custom buttons are:
]; function cogPressed(e) but the event never looks to be hit? Is there a different way I should use it? |
Thank you very much for the example, I managed to use it and get what I needed using a hidden span within the content and getting it that way. Thanks again and really appreciate the assist. |
…bute must be a `object` with pairs `key: value` where `key` - attribute name, `value` - attribute value, issue #1592
New in 4.4.0
Now you can: <div data-role="window" class="p-2" data-on-drag-start="dragStart" data-on-resize-start="resizeStart" data-custom-buttons="customButtons">
This is a simple window
</div> var customButtonHandler = function(btn){
console.log($(btn).attr("data-custom-id"));
console.log($(btn).attr("data-special-attr"));
}
var customButtons = [
{
html: "<span class='mif-cog'></span>",
onclick: customButtonHandler,
cls: "alert",
attr: {
"data-custom-id": "myID_1",
dataSpecialAttr: "additional attribute"
}
}
]; |
Nice update, this is very useful |
…bute must be a `object` with pairs `key: value` where `key` - attribute name, `value` - attribute value, issue #1592
I have dynamically created a window and want to be able to pass a variable to an event e.g. data-custom-id from the window DIV should be sent to the cog press event cogPressed(ID). I cant see anyway of doing this though and the buttons appear to have to be global instead of making those dynamically too.
How can i get the information of the window which calls the event on the custom button?
The text was updated successfully, but these errors were encountered: