The code I have comes from the DWR project:
There is getRows(), removeAllRows() which do obvious things to tables.
To edit lists (both select lists and ul, ol lists) see addOptions()
and removeAllOptions().
The functions getValue(id) and setValue(id, value) work out what the
element is and if we should be using .innerHtml or .value or something
else.
These 2 get much more useful with getValues(obj) and setValues(obj)
which take an object where the keys match HTML ids. This makes
manipulating ''forms'' easy - all the data for a form is in an
object. I
put form in quotes because it''s just a collection of HTML ids and not
a real <form ...>
The code is documented here: http://getahead.ltd.uk/dwr/browser/util
It would require some refactoring to fit with the Scriptaculous way of
doing things, but I could do that fairly quickly.
Thomas - I''d value your opinion. Is this the kind of thing that you
invisage ever being in Scriptaculous?
Joe.
On 8/22/05, Eric Fleming <efleming@gmail.com>
wrote:> Definately an interest here.
>
>
> On 8/21/05, Joe Walker <joseph.walker@gmail.com> wrote:
> >
> > Hi,
> >
> > Is there any interest in data binding functions? I''ve got
several
> > functions that enable you to populate tables, select lists and forms
> > etc using js arrays and objects.
> >
> > It could be useful to anyone using Ajax, computed javascript or any
> > other mechanism to read data from a server separately from the HTML.
> >
> > Any interest?
> >
> > Joe.
> > _______________________________________________
> > Rails-spinoffs mailing list
> > Rails-spinoffs@lists.rubyonrails.org
> >
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
> >
>
>
>
> --
> Eric Fleming
> efleming@gmail.com
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
>
>