Message from discussion
Object.implement Problem
Received: by 10.52.174.201 with SMTP id bu9mr1802791vdc.5.1348380658032;
Sat, 22 Sep 2012 23:10:58 -0700 (PDT)
X-BeenThere: mootools-users@googlegroups.com
Received: by 10.52.36.237 with SMTP id t13ls3590104vdj.3.gmail; Sat, 22 Sep
2012 23:10:55 -0700 (PDT)
Received: by 10.52.90.69 with SMTP id bu5mr1478910vdb.6.1348380655644;
Sat, 22 Sep 2012 23:10:55 -0700 (PDT)
Date: Sat, 22 Sep 2012 23:10:55 -0700 (PDT)
From: Peter <peter.hilsc...@freenet.de>
To: mootools-users@googlegroups.com
Message-Id: <c116c805-9e19-4960-9c58-337a8948f629@googlegroups.com>
In-Reply-To: <b041f1d7-ef6f-4e80-9079-8f55942348fb@googlegroups.com>
References: <b041f1d7-ef6f-4e80-9079-8f55942348fb@googlegroups.com>
Subject: Re: Object.implement Problem
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_909_26058392.1348380655270"
------=_Part_909_26058392.1348380655270
Content-Type: multipart/alternative;
boundary="----=_Part_910_31664817.1348380655273"
------=_Part_910_31664817.1348380655273
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
No, there is no right Element.implement.
I have a Function getChecked
function getChecked() {
var count=0;
var valuess = '';
if(typeOf(el)=='elements') {
el.each( function(el) {
if(el.get('checked')) {
count++;
if(valuess!="") valuess +=',';
valuess += el.get('value');
}
});
} else {
if(el.get('checked')) { count=1; valuess=el.get('value'); }
}
return { 'count' : count, 'values':valuess } ;
}
var el = $$('myCeckboxes');
alert(getChecked(el));
The Idee is the function to use as implement for Object.
alert(el.getChecked().values);
It works when not a call for setStyles, but when i use set Styles, Mootools
call the implemented Function as style ???
$('myDiv').setStyles({ 'left':'10px', 'top':'20px' });
then Mootools makes in Element.implement
setStyle( left ...
setStyle( top ...
setStyle( getChecked ...
I want to understand why this does not work.
Greetings,
and sorry for my bad english
------=_Part_910_31664817.1348380655273
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
<br><span id=3D"result_box" class=3D"short_text" lang=3D"en"><span class=3D=
"hps">No,</span> <span class=3D"hps">there</span> <span class=3D"hps">is no=
</span> <span class=3D"hps">right</span> <span class=3D"hps">Element.implem=
ent.<br><br>I have a Function getChecked<br><br>function getChecked() {<br>=
var count=3D0;<br> var valuess =3D '';=
<br> if(typeOf(el)=3D=3D'elements') {<br> &nbs=
p; el.each( function(el) { <br> =
if(el.get('checked')) { <br> &nb=
sp; count++;=
<br> &=
nbsp; if(valuess!=3D"") valuess +=3D',';<br> =
valuess +=3D el.get('value');<=
br> }<br> &nbs=
p; });<br> } else {<br> &nb=
sp; if(el.get('checked')) { count=3D1; valuess=3De=
l.get('value'); } <br> &nbs=
p; } <br> return { 'count' : count, 'va=
lues':valuess } ;<br>}<br><br><br>var el =3D <span id=3D"result_box" class=
=3D"short_text" lang=3D"en"><span class=3D"hps">$$('myCeckboxes');<br><br>a=
lert(getChecked(el));<br><br>The Idee is the function to use as implement f=
or Object.<br><br>alert(el.getChecked().values);<br><br>It works when not a=
call for setStyles, but when i use set Styles, Mootools call the implement=
ed Function as style ???<br><br>$('myDiv').setStyles({ 'left':'10px', 'top'=
:'20px' });<br><br>then Mootools makes in Element.implement<br><br>setStyle=
( left ...<br>setStyle( top ...<br>setStyle( getChecked ...<br><br>I want t=
o understand why this does not work.<br><br>Greetings,<br>and sorry for my =
bad english<br><br><br><br></span></span></span></span>
------=_Part_910_31664817.1348380655273--
------=_Part_909_26058392.1348380655270--