Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
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>=
&nbsp;&nbsp;&nbsp; var count=3D0;<br>&nbsp;&nbsp;&nbsp; var valuess =3D '';=
<br>&nbsp;&nbsp;&nbsp; if(typeOf(el)=3D=3D'elements') {<br>&nbsp;&nbsp;&nbs=
p; &nbsp;&nbsp;&nbsp; el.each( function(el) { <br>&nbsp;&nbsp;&nbsp; &nbsp;=
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(el.get('checked')) {&nbsp; <br>&nbsp;&nb=
sp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; count++;=
 <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&=
nbsp; if(valuess!=3D"") valuess +=3D',';<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;=
&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; valuess +=3D el.get('value');<=
br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbs=
p;&nbsp; &nbsp;&nbsp;&nbsp; });<br>&nbsp;&nbsp;&nbsp; } else {<br>&nbsp;&nb=
sp;&nbsp; &nbsp;&nbsp;&nbsp; if(el.get('checked')) { count=3D1; valuess=3De=
l.get('value'); }&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbs=
p; }&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; 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--