Hide Button(control) from other kind

edited October 2016 in General
Hi everybody.
I've a question.
How can capture the the click event from a button in a popup?
I need capture the click, to do something.
This popup is in a kind, but i need capture the click from inner button (Accept) in my own kind.
With jquery i do like this:
$(document).ready(function()
{
//AppModal (name of the popup)
$("#AppModal_bodyButtons_btnModalAccept").click(function ()
{
alert('**** TEST ****');
$("#App_containerMainWindow_btnInvoice").hide();
});
});
In this case: #AppModal_bodyButtons_btnModalAccept is the button id within the popup (AppModal), and i need that when the user clicked this button then deactivate another button but in the main form (App_containerMainWindow).

I thought do it this way, but I'm not clear on how to do it correctly
enyo.kind({
name: 'MyTestKind',
myFunction: function() {
(document).ready(function()
{
$("#AppModal_bodyButtons_btnModalAccept").click(function ()
{
alert('**** TEST ****');
$("#App_containerMainWindow_btnInvoice").hide(); });
});
}
});
The other question is how to deactive the other button (App_containerMainWindow_btnInvoice), this button is within the main window (another kind), i need do this within my kind (MyTestKind) ...?

Regards.

Comments

  • The Enyo approach to this scenario is to bubble an event up from the button to a common ancestor which can hide the button either by setting a property or calling a method.

    Hope that gets you going in the right direction but please share a more complete sample if you are still having trouble.
  • Thanks, I'll do a test and then tell you how it goes me with this code... :smile:
Sign In or Register to comment.