Page 1 of 2
Disabling onrowdblclick event
Posted: Fri May 10, 2013 2:41 pm
by Karthik
I have a dropdown in my subfile. I also have an onrowdblclick event. I would like these to be mutually exclusive. Is there a way to disable onrowdblclick when the dropdown is enabled?
Re: Disabling onrowdblclick event
Posted: Fri May 10, 2013 8:13 pm
by Scott Klement
I'm not sure that I understand. These two options should not conflict, because you don't need to double-click when you're using a drop-down.
Are they conflicting?
If not, an easy solution might be to have code in your onrowdblclick event that checks if the drop-down is enabled, and if it's enabled, just do nothing, exit the onrowdblclick function.
If they are conflicting, then please describe the problem so I can understand better, and maybe find a solution.
Re: Disabling onrowdblclick event
Posted: Mon May 13, 2013 9:17 am
by Karthik
When user clicks on the dropdown in the subfile, doesnt make a selection and releases the mouse button, it happens fast so system assumes user double clicked on the row causing the onrowdblclick event to fire and control coming into the program. If there is a pause between mouse button down and up the onrowdblclick doesn't fire. I understand what you are saying but not sure of the js that I need to include. Would appreciate it if you can show me what I need to include. Thanks.
Re: Disabling onrowdblclick event
Posted: Mon May 13, 2013 11:30 am
by Scott Klement
When you refer to the drop-down as "enabled" or "disabled", do you mean that the "disabled" property is set to true (for disabled) or false (for enabled)? Or do you mean something else?
Re: Disabling onrowdblclick event
Posted: Mon May 13, 2013 11:46 am
by Karthik
I have bound the disabled property on the dropdown to a field and setting on to disable and off to enable within my program. When disable on the dropdown is on, I would like the onrowdblclick event to be enabled and vice-versa. Other thing I noticed is that when I take a look at the HTML, id for the dropdown on the 1st subfile record is "Dropdown1.1". Id within designer is "Dropdown1".
Re: Disabling onrowdblclick event
Posted: Mon May 13, 2013 10:50 pm
by Scott Klement
Just code something like this in your onrowdblclick:
Code: Select all
var dropdown = getObj("Dropdown1." + row);
if (dropdown.disabled) {
// do your double click logic here.
}
So if the dropdown is enabled, you don't run the double-click code.
Re: Disabling onrowdblclick event
Posted: Tue May 14, 2013 7:50 am
by Karthik
Works great. Thank you.
Re: Disabling onrowdblclick event
Posted: Tue May 14, 2013 9:45 am
by emhill
I'm going to hijack this thread for a similar problem I am having. I have sent a request to support but have not heard back from them. I sent them one of the DDS's in question.
We are having a fairly major dropdown problem in Internet Explorer 9.
We have screens that have a dropdown that is a part of a grid/subfile AND have a default action assigned to the onrowclick property. In IE9 whenever a selection is made on the dropdown in the row it is picking up the onrowclick action and using it. If we use our arrow key on the dropdown to select and the press ENTER or click Submit, it will work ok but that is a lot to ask of a user.
This seems to have happened after we upgraded to 4.5.2. Other versions of Internet Explorer seem to work ok and Chrome works ok as well.
Any idea what is going on with this and do you have a workaround similar to the one shown above?
Thanks!!!!!
Re: Disabling onrowdblclick event
Posted: Tue May 14, 2013 10:52 am
by Scott Klement
I must admit, I was unable to reproduce the problem that Karthik reported, and I'm also unable to reproduce the problem that you're having, Eric.
Are you also disabling your dropdowns some of the time? If so, the exact same code (except, placed in the onrowclick) should work...?
Re: Disabling onrowdblclick event
Posted: Tue May 14, 2013 11:08 am
by Scott Klement
Hmm.. actually, I take that back, Eric.. I can reproduce your problem. Scott W. has a copy of your display file, and sure enough, the onrowclick event fires whenever you click the dropdown.
It was happening for me in Firefox and IE10. So it doesn't seem to just be IE9...