Retrieve all Stores values

5 views
Skip to first unread message

Jan

unread,
Jan 24, 2010, 1:15:37 PM1/24/10
to MooTools Users
Hi,
is there an elegant way of retrieving all stored values of an
Element ?
Let's say: $("myElement").retrieveAll(); ?
And going even further, would it then be possible to only get those
values which keys follow a searchstring: $("myElement").retrieveAll
("^item") ?
Thanks,
Jan

Roman Land

unread,
Jan 24, 2010, 1:23:41 PM1/24/10
to mootool...@googlegroups.com
Not an answer but more of a suggestion, why not use a Hash? (or array/ object)
--
---
"Make everything as simple as possible, but not simpler."

- Albert Einstein

Jan

unread,
Jan 25, 2010, 8:56:02 AM1/25/10
to MooTools Users
Hi Roman,
you mean like this ?

var myHash = new Hash({
aProperty: '10',
anotherProperty: '20'
});
var myotherHash = new Hash({
aProperty: '100',
anotherProperty: '200'
});
test = [myHash, myotherHash];
$("testdiv").store('test', test);
console.log("test: %o", $("testdiv").retrieve('test'));

This works flawlessly, thanks for pointing me in the right direction !
Cheers,
Jan


On 24 Jan., 19:23, Roman Land <roman.l...@gmail.com> wrote:
> Not an answer but more of a suggestion, why not use a Hash? (or array/
> object)
>

Roman Land

unread,
Jan 25, 2010, 9:54:19 AM1/25/10
to mootool...@googlegroups.com
Happy to help!
Cheers!
Reply all
Reply to author
Forward
0 new messages