Comments (3)
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.
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.
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)
- Out of stack space HOT 4
- stack overflow error in version 0.5, but not in 0.4.3 HOT 6
- Click on parent node does not automatically check all child nodes HOT 3
- onCheck options do not work HOT 4
- jquery 1.6 problem HOT 3
- Replace .attr('checked' with .prorp('checked' HOT 1
- Feature request: Configurable minimum expansion level (regardless of checked state) when the checkboxtree is initialized HOT 1
- Feature request: Make it possible to initially fully expand nodes only if a subset of nodes is selected and do not expand if all subnodes are selected HOT 1
- single branch selection and multiple choice children HOT 2
- Exclude some nodes inside the tree HOT 1
- Expand all sub element on Click HOT 4
- Limiting the number of checkboxes selected by user HOT 1
- IE7 support HOT 3
- [deleted issue]
- Calling Method HOT 15
- tree not working in IE9
- Input XML and return XML with checked values
- Changing direction of tree view HOT 1
- checkboxtree Not Working with AJAX HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from checkboxtree.