This is a migrated thread and some comments may be shown as answers.

RadComboBox OnClientBlur never fires

6 Answers 213 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Amarbir
Top achievements
Rank 1
Amarbir asked on 19 Aug 2020, 10:45 PM

Upgraded UI for ASP.NET AJAX controls and OnClientBlur neverfires. Here is the markup:

<telerik:RadComboBox ID="radComboHansenClerks" CheckBoxes="true" AutoPostBack="false"
                        LabelCssClass="control-label" AllowCustomText="false" CloseDropDownOnBlur="true"
                        OnClientBlur="IsCheckAllSelected" CheckedItemsTexts="DisplayAllInInput" ShowDropDownOnTextboxClick="true"
                        runat="server" Filter="Contains" NoWrap="True" MaxHeight="400px" Width="100%"
                        AccessibilityMode="true" EnableCheckAllItemsCheckBox="true" Localization-CheckAllString="Select All"
                        OnItemChecked="radComboHansenClerks_ItemChecked">
                         
                    </telerik:RadCombo
function IsCheckAllSelected(sender, eventArgs) {                                              
              $('#<%= btnRadclerksFilter.ClientID %>').click();               
      }
Box>

6 Answers, 1 is accepted

Sort by
0
Amarbir
Top achievements
Rank 1
answered on 19 Aug 2020, 10:47 PM
web UI verison: 2020.1.219.40
0
Amarbir
Top achievements
Rank 1
answered on 21 Aug 2020, 03:47 PM
Is everyone on vacation?
0
Doncho
Telerik team
answered on 24 Aug 2020, 09:30 AM

Hi Amarbir,

I am afraid we are not aware of such an issue with the RadComboBox.

A possible cause for the unexpected behavior could be an eventual JavaScript error on the page. I would suggest you use the DevTools of your browser to monitor the Console for errors. Check out the Improve Your Debugging Skills with Chrome DevTools blog post as it may help you with the troubleshooting.

One more thing you can try In case you have Ajax enabled on the page, is to disable it temporarily and test the application while monitoring the Browser's Console for JavaScript errors again, see Get more descriptive errors by disabling AJAX.

I have tested the provided declaration of the ComboBox and it works as expected on my side, see http://somup.com/cYjZQY6NO3
I have used an alert method for testing:

function IsCheckAllSelected(sender, eventArgs) {
    alert('OnClientBlur fired!');
}

If the suggested above is not helping in troubleshooting the issue we would need to see a reproduction of the problem in order to help. Please share the steps to replicate the problematic behavior so that we can inspect it locally. It would also be helpful if you provide us a runnable sample that will show us the problem.

Kind regards,
Doncho
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

0
Amarbir
Top achievements
Rank 1
answered on 24 Aug 2020, 03:12 PM

Hi,

Thank you for the response. Here is what I have noticed. In your example it works because you do not have any items. OnClientBlur get fired when it drops down and you go out of focus WITHOUT selecting anything(or making any changes to existing selection). It does NOT work after you change the selection. Try adding a few items and selecting one or two.

0
Amarbir
Top achievements
Rank 1
answered on 24 Aug 2020, 03:14 PM
BTW there are no errors in console (even after disabling ajax as you suggested). That's the first thing I checked before I posted this problem.
0
Doncho
Telerik team
answered on 27 Aug 2020, 01:40 PM

Hi Amarbir,

Thank you for the clarification! It helped me understand the issue.

Indeed, this unexpected behavior has been reported in the following FeedbackItem - ComboBox' OnClientBlur not working correctly.

For your convenience, I am pasting the code from the feedback item, that you can use as a workaround:

<script>
	var onDocumentClick = Telerik.Web.UI.RadComboBox.prototype._onDocumentClick;
	Telerik.Web.UI.RadComboBox.prototype._onDocumentClick = function (e) {
		if (!e) e = event;

		var target = e.target || e.srcElement;

		while (target.nodeType !== 9) {
			if (!target.parentNode || target == this.get_element() || target == this.get_dropDownElement()) {
				e.preventDefault();
				return;
			}

			target = target.parentNode;
		}
		onDocumentClick.call(this, e);
	};
</script>

I hope that will help! Please let me know if any further questions come up!

Kind regards,
Doncho
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Tags
ComboBox
Asked by
Amarbir
Top achievements
Rank 1
Answers by
Amarbir
Top achievements
Rank 1
Doncho
Telerik team
Share this question
or