jQWidgets Forums
jQuery UI Widgets › Forums › General Discussions › Lists › DropDownList › Excluding DropDownList in-list Select All from Content
Tagged: DropDownList, javascript dropdown list
This topic contains 3 replies, has 2 voices, and was last updated by Peter Stoev 8 years, 7 months ago.
-
Author
-
I am trying to add a “(Select All)” checkbox to a DropDownList.
I implemented it similar to the jqxgrid CustomFilter demo
http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/customfiltering.htm?classicHowever, the content includes “(Select All)” when everything is selected.
I tried to remedy this by setting the content directly on select and checkchange by both setContent and updating the content div text directly like this example:
http://www.jqwidgets.com/community/topic/checkboxes-with-an-allnone-option/This works when I’m stepping through the code in a debugger, but when I’m running live, the content is updated automatically after I update it.
Is there some way to override the content that is being written to the DropDownList so that the checklist does not cause it to update?
Hi Gary,
That item is a valid List item inserted dynamically to the DropDownList widget and as such it will be always included in the getChekedItems array, if that is what you mean by content. As the result is an Array, you can build a custom array which excludes the first array item.
Best Regards,
Peter StoevHi Peter,
My issue is that visually, this is what I’m seeing:[(Select All),alpha,beta,gamma,delta v]
[x] (Select All)
[x] alpha
[x] beta
[x] gamma
[x] deltaWhat I want to see on the top line is:
[alpha,beta,gamma,delta v]Since the text of the DropDownList is auto-generated based on the checklist selection, I would like to override that auto-generated text to not include “(Select All),”. The setContent() method appears to correctly update the text, but the auto-generated text is overwriting my value in some cases. Setting it on a subsequent event (like on close) does not get overwritten.
So I think my question is, can I turn off the auto-generation of the text, override the text generator, or be given a better idea of what specifically triggers the text to be updated so that I can try to ensure I call setContent() after it is called. I’ve tried updating at the end of the change, select, checkchange, and unselect events, but the auto-generate still occurs afterwards.
Best Regards,
-Gary GeniesseThen do not use the built-in filtering editors as you don’t have access to override them and build a custom filter such as http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/filtering-menu-custom-widgets.htm?light
Best Regards,
Peter Stoev -
AuthorPosts
You must be logged in to reply to this topic.