How to disable a button after click in limejs - limejs

How do I disable a button after click in limejs? I have tried using
this.disable()
but it does not work.

You can also use goog.events.listenOnce. Identical signature to goog.events.listen and will only fire once.

Try goog.events.listen and goog.events.unlisten:
goog.events.listen(my_button, ['mousedown','touchstart'],function_triggered_onClick);
goog.events.unlisten(my_button, ['mousedown','touchstart'],function_triggered_onClick);
goog.events.unlisten will disable the button untill code reaches goog.events.listen again

Related

Extjs 6 Ext.grid.plugin.RowEditing Remove Update / Cancel buttons

I am trying to remove update cancel buttons.
but no any config's are available for this.
I have tried to override but i cant remove this.
please if you have done task like this or know how to do this help me.
You're absolutely right that there is no built-in way to hide the update and cancel buttons with the row editing plugin.
You could try to hide the button bar via CSS. The normal CSS class name is x-grid-row-editor-buttons. But this may cause other problems.
Or, you could try a different editor, such as the CellEditing plugin - this lets you edit one cell at a time, as opposed to showing the editors for the entire row, and doesn't use buttons.
You might be able to remove the button by overriding the Ext.grid.plugin.RowEditing. A quick look at the source shows me an array with in the initEditiorFunction() which looks like this.
btns = ['saveBtnText', 'cancelBtnText', 'errorsText', 'dirtyText'],
Try removing the cancelBtnText button, and perhaps it won't show on there? I haven't tested this but this might be something in the right direction.

Clear button click listener in droidparts ClerableEditText

I want to have a click listener for the clear button in the ClerableEditText from droidparts.
Thanks.
You can set a ClearableEditText.Listener instance which didClearText() method will be called when the clear button is pressed(or actually released).

primefaces notificationbar autohide

I have a notificationBar and a commandButton to show it. It works fine, but I need the notificationBar hide itself without the need to click a commandButton to hide it.
Is this possible?
Thanks.
Generally what you have to do to close the notificationbar is the following is to call notificationWidget.hide() when you specified widgetVar="notificationWidget" as a attribute of the notificationbar.
If you would like to have a cross inside the bar to close it, you have to put a commandButton or just a button inside the notificationbar and which calls notificationWidget.hide() on click.
To close the notificationbar after some fixed time you have to register a timer when the notificationbar shows. I.e. setTimeout(notificationWidget.hide, 3000) to close it after 3 seconds.
If you know more exactly what you want to do give some more information or some code, so that i can give you some more concrete answer.

jQuery - Trigger() once every click

I've ran into a problem with something quite simple. When I click #mybutton I want to trigger a click on another button.
$('#mybutton').click(function(){
$('#otherbutton').trigger('click');
});
When I first click #mybutton the #otherbutton will trigger once. When I click #mybutton the second time the #otherbutton will trigger twice. When I click #mybutton the third time the #otherbutton will trigger three times...and so on.
How can I stop this so that #otherbutton will only trigger once for each click of #mybutton?
EDIT
Aha! I've just realised this is due to fancybox (where the buttons live).
The buttons are clicked from fancybox popop, which is also triggered to open every time before the buttons are clicked.
$('#planApp-link').fancybox().trigger('click');
I'm still not sure how to prevent this from happenning.
instead of using trigger("click") u can use
$('#otherbutton').click();
this function it ll trigger the click function
$(".clas1").on("click",function(){
$(".clas2").click();
});
$(".clas2").on("click",function(){
alert("div2");
});
.

How to implement radio button in iPhone?

I want to add buttons like radio button. i have created round rect button but no idea about radio button.
How can I do it? This how I implement checkbox button feature.
any help please ?
The best way of achieving this is setting a normal and a selected image for each button. You can then easily switch each button on or off using the selected property:
myButton.selected = YES;
There is no direct UI for radio button you have to use images on UIbutton so that you can replace the checked images when a user press on the button just like tableview check/ uncehck functionality .It is just a trick by which you can make feel of a radio button.
I've written a controller for handling the logic behind an array of radio buttons. It's open source and on GitHub, check it out!
https://github.com/goosoftware/GSRadioButtonSetController
Check out DLRadioButton! It supports not only radio buttons but also checkboxes. If you have any questions, please feel free to leave a comment.

Resources