Event for when a checkbox is unchecked in ExtJS? - events

In ExtJS the change event is used for making something happen when a checkbox is checked, so, I'm wondering what event should be used to make something happen when the checkbox is unchecked?
Thank you.

The same change event should fire when the checkbox is unchecked. Ext will pass the new value and the old value as params to your handler.
http://docs.sencha.com/extjs/6.2.1/classic/Ext.form.field.Checkbox.html#event-change

Related

How to unselect any selected record in an infragistics XamDataGrid?

I have a XamDataGrid with XamComboEditor as its CellValuePresenter.
I have written a handler for XamComboEditor SelectionChanged event (XamComboSelectionChanged) that updates my collection as per selected item.
When I apply filter to the XamDataGrid from its header, it triggers XamComboSelectionChanged event handler somehow and the value from XamDataGrid.ActiveRecord gets updated due this event handler. I want to avoid this.
This problem does not occur if I don't click on any record. i.e. XamDataGrid.ActiveRecord is null.
If there is any way I can unselect the selected row my problem would be solved.
I have tried setting XamDataGrid.ActiveRecord = null in RecordFilterChanged event of XamDataGrid didn't work.
XamDataGrid.ActiveRecord.IsActive = false didn't work.
XamDataGrid.ActiveRecord.IsSelected = fals didn't work.
Also I tried to update dependency property but I can only set it to any other record only which still causes same issue:
xamDataGrid.SetValue(XamDataGrid.ActiveRecordProperty, xamDataGrid.Records[0]); -- can't set anything out of index here.
Please help
Thanks

Trigger validation and redraw on different component via ajax

I have a wicket page with a couple of TextFields that have different kind of validators. So far, validation is triggered via Ajax on the onChange event.
I also have a checkbox that defines which set of validation rules should be used for the TextFields.
If I click the checkbox and then input data into the TextFields, validation works just fine. But how do I handle the fact that already entered and validated data can suddenly become invalid if the checkbox is clicked afterwards? How do I trigger the validation and the redraw (to show the error notification) of the TextFields from within an AjaxEvent from the checkbox?
I tried to call myTextField.validate() but that didn't trigger any of my validators.
Since your validation is based on multiple components you should implement IFormValidator. Pass both checkbox and textfield in getDependentFormComponents() and change of either will trigger it.
Also if you are using checkbox to refresh some elements make sure to use AjaxCheckbox, that has onUpdate(AjaxRequestTarget) method.
You could attach an AjaxFormSubmitBehavior in the checkbox. This would submit the form and trigger validation each time the checkbox value is toggled.

Flexicious DataGrid FlexDataGirdEvent.EDIT_END special case

I have a Flexicious DataGrid set up, and I have an ItemRenderer set on a certain column. Now, when I am editing an editable cell, and then stop editing it, the DataGrid fires a FlexDataGrid.EDIT_ITEM_END event (or something like that). When this is fired, I want to do a certain action. That's simple enough. The problem though, is I have a special case:
If a user is editing an editable cell and then clicks away from it (which would cause FlexDataGrid.EDIT_ITEM_END fire), but he happens to click on a button which is within the ItemRenderer set on the column, then in that case I don't want to do the action. I don't know how to make an event work like this though.
Basically I'm looking for an event that is FlexDataGrid.EDIT_ITEM_END_AND_CLICKED_ON_ANYTHING_OTHER_THAN_THAT_BUTTON and I'd like to fire that instead of FlexDataGrid.EDIT_ITEM_END. But alas, I checked the docs and that event doesn't exist =-(.
What can I do? Thanks for the help!
Have you tried ITEM_EDIT_CANCEL? This has a triggerEvent which should have a target property that should tell you what display object the click happened on.

Changing inputType of Ext.form.TextField does not affect immediately

In my program, I want to change the inputType of Ext.form.TextField when clicking another control. You an imagine about the password textfield and a "Show/Hide" button. I register event for the "Show/Hide" button to change the display form of password. But because that textfield has already rendered before this button click event was fired, so the inputType of it dis not affect immediately. Can you help me? Thank in advance.
The config options are not properties in the sense of C# for example, changing them does nothing because there's no way for the object to know you've changed them, which is usually why you have the many set* methods.
However there is no method for this for TextField so you'll probably have to re-create the object with the required configuration.

How can i add a MouseDown event handler to a <asp: button> control?

I have a aspx page that contain "asp:RequiredFieldValidator" controls;Problem that is when each of "asp:RequiredFieldValidator" controls activate and show their messages; other controls in my page don't working even "CANCEL" button!!!
i want to enable controls in my "NEXT" button MouseDown and then disable them at my "NEXT" button MouseUp.
Thanks for any other solutions...
Specifically to answer your question as stated in your title: to add additional event handlers to an asp:button or other server controls that are not composite you simply add the handler to the element. Include onmousedown="myMouseDownHandler(this);" in the element and the javascript function myMouseDownHandler will fire.
However, I think there is a better way to do what your asking but the description of the question is not coherent enough for me to quite figure out what you're asking. I realize you may not be a native English speaker but perhaps you could give it another pass.
Use ValidationGroup property on controls that are validated and controls that triggers validation (e.g. save/update buttons) and on validators. Additionally set CausesValidation property to false on each button that does not need to trigger validation (cancel button).

Resources