Code Monkey home page Code Monkey logo

Comments (11)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 27, 2024
How does one call this function from the aspx page ?

Is it something like

$('mydropdown').updateSelection() ;

Original comment by [email protected] on 8 Sep 2009 at 10:30

from dropdown-check-list.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 27, 2024
to call this use:

$('#mydropdownID').dropdownchecklist("updateSelection");

Original comment by [email protected] on 8 Sep 2009 at 10:38

from dropdown-check-list.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 27, 2024
Thanks. Do you have a function for unchecking all the items ? or possibly point 
me in
the right direction ?

Original comment by [email protected] on 8 Sep 2009 at 10:57

from dropdown-check-list.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 27, 2024
@victorbh: have a look at _syncSelected function for some clues.
Something like below will do it (if you don't need to keep track of the 
firstItemChecksAll option):

 selectAll: function() {
            var allCheckboxes = this.dropWrapper.find("input");
            allCheckboxes.attr("checked", true);

            // do the actual synch with the source select
            var selectOptions = sourceSelect.get(0).options;
            allCheckboxes.each(function(index) {
                $(selectOptions[index]).attr("selected", true);
            });

            // update the text shown in the control
            self._updateControlText();
        }, 

and then call with $("#s1").dropdownchecklist("selectAll")

Original comment by adrian.tosca on 12 Sep 2009 at 6:38

from dropdown-check-list.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 27, 2024

Original comment by adrian.tosca on 12 Oct 2009 at 7:19

  • Changed state: Done

from dropdown-check-list.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 27, 2024
Sorry about this novice question, but I can't see the "updateSelection" function
defined in the latest release - 0.9. Has it been done as a different function 
name?

Original comment by kevinjansz on 23 Mar 2010 at 1:42

from dropdown-check-list.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 27, 2024
As of version 0.9 the function is not needed because ddcl automatically 
synchronizes 
with values changes in the source select. What are you trying to do?

Original comment by adrian.tosca on 23 Mar 2010 at 12:22

from dropdown-check-list.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 27, 2024
We've got a separate (non-jQuery, legacy) script that does a select all/none on 
the
input. Perhaps the way this script works, but when it runs I can see the hidden
select is being updated (as it would if DDCL was not applied) but the dropdown 
widget
didn't seem to automatically synch. That would be awesome if it did - is that 
the
expected behaviour? 

If I add in the updateSelection function and then call this explicitly after the
select all/none script it seems to work perfectly - ie takes the selects from 
the
hidden select. 

I'm attaching a test case if it helps (drop this in the ddcl/src folder). The 
first
select all/none shows the auto-synch isn't happening. 

Original comment by kevinjansz on 23 Mar 2010 at 10:57

Attachments:

from dropdown-check-list.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 27, 2024
saw the comment on the demo page - update from selection can be achieved with a
destroy and recreate, ie no need for "updateSelection" function:
$("#select").dropdownchecklist("destroy");
$("#select").dropdownchecklist();

thanks, great work

Original comment by kevinjansz on 25 Mar 2010 at 4:31

Attachments:

from dropdown-check-list.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 27, 2024
If you're programmatically changing the value of the source select, you'll need 
to 
trigger a change event on the select to get ddcl to recognize the change.

Example:
$("#sourceSelect option").attr("selected","selected");
$("#sourceSelect").trigger('change');

If you're not using jQuery you'll need to find another way to trigger the 
change...

Original comment by [email protected] on 4 Apr 2010 at 11:56

from dropdown-check-list.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 27, 2024
Hi Need ur help on following scenario:
---------------------------------------
Here is my list

All
A
B
C
D
1
2
All History

I wanted to write code whenever any or all (A,B,C,D) is selected uncheck "All"
Note: here selection of ALL dhould not select every Item in list.
please give some snippet which i can put in my jsp call also

Original comment by [email protected] on 3 Mar 2011 at 7:58

from dropdown-check-list.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.