Menu

#1308 Enhance jQuery selector to handle zk widget's ID

5.0.2
closed
nobody
5
2014-08-27
2010-03-18
Jumper Chen
No

For example,

jq('div$abc');

Discussion

  • Jumper Chen

    Jumper Chen - 2010-03-18

    Ready since 2010/03/18.

    For example,

    1. jq('div > $abc') will return the two div(id=abc) elements.
    2. jq('div$win1 > $abc') will return the div element inside the win1 window.
    3. jq('$abc') will only return the first match element for better performance.
    4. jq('div$abc') will return the two div(id=abc) elements.

    <zk>
    <window id="win1">
    <div id="abc" class="abc"/>
    </window>
    <window id="win2">
    <div id="abc" class="abc"/>
    </window>
    </zk>

     
  • Jumper Chen

    Jumper Chen - 2010-03-18
    • status: open --> closed
     
  • Jumper Chen

    Jumper Chen - 2010-03-26

    Update the specification, the $ sign is used for ZK widget's ID and the @ sign is used for ZK widget's tag name.

    For example,

    1. jq('@window > $abc') will return the two div(id=abc) elements.
    2. jq('@window[class~="abc"] @div') will only return the div where is inside the window with "abc" CSS class name.
    3. jq('div$win1 > $abc') will return the div element inside the win1 window.
    4. jq('$abc') will return all the elements that match from the given id.
    5. jq('@div') will return all the elements that match from the given tag name.
    6. jq('@window:first') will return id="win1"
    7. jq('@window[border="normal]"') will return id="win1".

    <zk>
    <window id="win1" class="abc" border="normal">
    <div id="abc" class="abc"/>
    </window>
    <window id="win2">
    <div id="abc" class="abc"/>
    </window>
    </zk>

     

Log in to post a comment.