[Seaside] Re: Setting checkboxes using JQuery

Jan van de Sandt jvdsandt at gmail.com
Fri Dec 12 14:15:45 UTC 2008


Hello,

I think I found the solution:

    html div: [
        html text: 'Select: '.
        html anchor
            onClick: ((html jQuery expression: ':checkbox:not(:checked)')
trigger: 'click' );
            with: 'All, '.
        html anchor
            onClick: ((html jQuery expression: ':checkbox:checked') trigger:
'click' );
            with: 'None' ].

This works perfectly :-)

Jan.


On Fri, Dec 12, 2008 at 2:53 PM, Jan van de Sandt <jvdsandt at gmail.com>wrote:

> Hello,
>
> I'm using Seaside 2.9, Squeak and the new Seaside JQuery support. I'm
> creating a table where each row has a checkbox, just like GMail I want to
> provide a "Select all" and a 'Select none" link.
>
> My idea is to use JQuery to select or unselect all checkboxes:
>
>     html anchor
>         onClick: ((html jQuery expression: ':checkbox') value: 'checked');
>         with: 'All, '.
>
> The problem is that this adds the value="check" attribute to all checkbox
> elements but I need the checked="checked" attribute!
>
> I also tried:
>
>     html anchor
>         onClick: ((html jQuery expression: ':checkbox') do: [ :each | each
> click ]);
>         with: 'All, '.
>
> But this doesn't work because the JQueryInstance object has no click
> method.
>
> Can anyone help me out?
>
> Jan.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20081212/28032137/attachment.htm


More information about the seaside mailing list