Giter VIP home page Giter VIP logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 30, 2024
Regarding the label text, I think it would be good if it will be able to match 
all node texts within the label element, for example within a span element that 
can be set to visually hidden.

For example, you might have a option displaying the text "United States" but 
want the option to become expanded also if the end user writes some other text 
that might be typically used in common language, for example "US" or "USA" (and 
in this example it is enough to specify "USA" in the hidden text since it 
contains the substring "US" too).

This is the kind of element I want the regular expression to be able to match:

<label><input type="checkbox" value="12345" />United States<span 
style="visibility:hidden">USA,Uncle Sam</span></label>

Basically, the node texts should be flattened out (stripping away html 
elements) into (in this example) "United States USA,Uncle Sam".

Then some regular expression might be used for matching some part of that 
string.

For example, if the end user wrote the string "US" in the text input field, 
then I (i.e. the programmer) might concatenate it (though possibly with some 
additional escaping of special reg exp characters) with some regular expression 
prefix/suffix into the following regular expression string: "^.*US.*$".

That regular expression could then be provided as a parameter to the desired 
method.

Original comment by [email protected] on 2 Jul 2011 at 9:27

from checkboxtree.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 30, 2024
When thinking more about this I realize that it is not the matching node that 
should become expanded, but it is the parent node of the matching node that 
should become expanded, to display the matching node.

For example, let us say there is a root node "USA" and then there are subnodes 
with states e.g. "California", and the states have subnodes with cities e.g. 
"Los Angeles".


If the end user (of my desired feature that supports programmatic expansion of 
parent nodes matching a substring) enters the string "California" then the node 
"USA" should become expanded (to make "California" visible).
If the end user writes "Los Angeles", then the node "California" should become 
expanded (to make "Los Angeles" visible).

Also, I think it would nice to optionally let a css class be specified as 
parameter, and the implementation should add span tags around the matching 
substring, to make it possible to (for example) making the matched substrings 
bold or/and italic.

Potential method signature:
expandAllParentOptionsWhichWillMakeMatchingLabelTextsDisplayed(regularExpression
ToMatchWithLabelTexts, optionalCssClassToApplyAroundTheMatchingSubstring)

Example invocation:
expandAllParentOptionsWhichWillMakeMatchingLabelTextsDisplayed("^.*California.*$
", "matchedSubstrings")

The above invocation should create the following span tag to become created 
with DHTML:
<label><input type="checkbox" value="987" />The <span 
class="matchedSubstrings">California</span> state</label>
assuming that ir originally looked like this:
<label><input type="checkbox" value="987" />The California State</label>

To make the matching parts more visible, I might use the following CSS styling 
together with the above used css class as below:

.matchedSubstrings {
    font-weight : bold,
    font-style : italic
}

Original comment by [email protected] on 2 Jul 2011 at 9:54

from checkboxtree.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 30, 2024
This is a very particular feature. Script has some methods to collapse/expand 
and check/uncheck nodes.

To work as described in this issue, developer can identfy the node in a 
personal way (regexp, jquery find, etc.) and simply pass relative node object 
to available methods in the following way:

$( ".selector" ).checkboxTree( 'check', <nthNodeFoundInPreferredWay>);

Original comment by [email protected] on 30 Oct 2011 at 3:42

  • Changed state: WontFix

from checkboxtree.

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.