PDA

View Full Version : [CLOSED][3.0rc2] Ext.DomQuery 2Pattern Disable?



Kazuhiro Kotsutsumi
30 Jun 2009, 5:22 PM
Hi.

Ext.DomQuery 2Pattern Disable in Ext JS 3.0 RC2.


1.E:has(S)

SELECTOR

Ext.select( 'p:has(.x-bar)', true ).each(function(el){
console.log(el);
});

HTML CODE

<p>
<div class="x-bar">message message ...</div>
<div class="x-foo">message message ...</div>
</p>

This code is not selected...mm..




2.E{display%=2}

SELECTOR

Ext.select( 'div{margin%=2}', true ).each(function(el){
console.log(el);
});

HTML CODE

<div style="margin:0">message message...</div>


This code is not selected...mm..


Is my usage wrong?
Other selectors moved as all were correct.

evant
1 Jul 2009, 2:34 AM
The markup in your first example is incorrect, if you look at how it gets parsed:



Ext.onReady(function(){
var bd = document.body, c = bd.firstChild;
while(c){
console.log(c);
c = c.nextSibling;
}
});


You'll see that the div are a sibling of the p tag, not a child.

The second doesn't work because margin will return a string, example:



<body>
<div class="x-bar" style="margin: 20px;">message message ...</div>
<div class="x-baz" style="margin: 25px;">message message ...</div>
<div class="x-foo" style="margin: 30px;">message message ...</div>
</body>


The margin in this case will be "20px 20px 20px 20px", which obviously isn't disivible by 2. Going to mark this as closed.

Kazuhiro Kotsutsumi
1 Jul 2009, 8:54 AM
hi.

1.E:has(S)

It was able to be understood to limit it to the one that it was possible to detect it by "nextSibling".


2.E{display%=2}

The content was able to be understood though a good example was not found.


thank you.

mystix
1 Jul 2009, 9:03 AM
Kazuhiro ??, i think something got lost in translation (did you use google translate?).

?????????????????????????
after which i'll try to (re)translate it with my limited japanese (<<-- sorry, this wasn't taught in japanese class :"> )

Kazuhiro Kotsutsumi
1 Jul 2009, 6:03 PM
??????

1.E:has(S)

nextSibling????????????????????????????


2.E{display%=2}

?????????????????????????????
???????(usage)???????