jQuery UI Widgets › Forums › Lists › ListBox › Dynamic content onclick
Tagged: checkboxes, checkChange, event, getCheckedItems, getItemByValue, jqxListBox, ListBox, onclick
This topic contains 8 replies, has 3 voices, and was last updated by Chris99 9 years, 8 months ago.
-
AuthorDynamic content onclick Posts
-
Hi,
I have a list box with checkboxes enabled and a custom renderer. This creates a table for each item in the list box, and the table has an onclick handler. The problem I am having is that the first click on the list box items is never detected, but all other ones are. Can you work out why this may be?
I have put together an example http://jsfiddle.net/Chris99/599z0tb6/
Cheers,
Chris
Hello Chris,
The above example works on our side. Please, make sure you are using the latest version of jQWidgets(3.8.0).
Best Regards,
NadezhdajQWidgets team
http://www.jqwidgets.com/Whilst I am working with 3.7.1 (I will update today) my Fiddle is using 3.8.0 and exhibits the behaviour I described in Firefox and Chrome.
What should happen it that every click to the section of the list box to the right of the checkbox shoud show an alert. However the first click does not produce an alert. All other clicks do however produce the alert.
Please can you have another look.
Chris
Hi Chris,
We tested the sample. Unfortunately, the sample tries to use event which is not supported. With jqxListBox, you can use only the events documented on the ListBox’s API page. The custom renderers are only for displaying custom HTML content, but you shouldn’t try to bind to events within the custom renderer.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
Thanks for confirming you were able to reproduce what I was seeing. I took the idea from a post of yours http://www.jqwidgets.com/community/topic/events-on-custom-rendered-elements/. I appreciate this is two years old, but I had hoped it was an approved way of doing things.
Cheers,
Chris
Hi Chris,
The sample there is a workaround. Workarounds generally should be avoided and things should be used in the documented way. We don’t support workarounds in newer versions and don’t test them when we change API or behavior in widgets. The workaround there is also about a ListBox without checkboxes which matters, because it was prepared for a very specific scenario. If you want to use a workaround, use this: http://jsfiddle.net/5r4uzzm9/
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comThank you for trying Peter, I really appreciate the time you have taken.
Unfortunately although this works perfectly on the desktop, when built into a PhoneGap application and deployed onto an Android device the mousedown event is not recognised.
Thanks again for your assistance,
Chris
Hi Chris,
For other devices, you will probably need to add handler for “touchstart” and by using jqxResponse check whether the device is Desktop or other.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comThanks Peter,
I am looking at this, but have been unable to get is working yet either on a device or when using device emulation in Chrome Developer tools.
Cheers,
Chris
-
AuthorPosts
You must be logged in to reply to this topic.