[Seaside] Generating an callback URL for third-party use

Esteban A. Maringolo emaringolo at gmail.com
Wed May 28 13:31:45 UTC 2014


Johan,

2014-05-28 3:12 GMT-03:00 Johan Brichau <johan at inceptive.be>:
> Bob's answer is similar, but I prefer to explicitly use jQuery's on:selector:do: method.
>
> The full documentation is here: http://api.jquery.com/on/
>
> This way of working with delegated events is really necessary if you have hundreds of callbacks to attach. That never scales and your performance will be horrible (large response size, large seaside session, ...)

Thanks for the advice. I looked into jQuery's docs and it's exactly
what I was needing. In fact they use a dataTable as example.

I added the handler this way:

html document addLoadScript: ((html jQuery: '#', tableId, ' tbody')
  on: 'click'
  selector: 'tr'
  do: (
    html jQuery ajax
      callback: [ :value | Transcript show: 'Clicked row: ', value; cr. ]
      value: (html jQuery this text) ) asFunction)

Now I need to transform that single ajax call into something more convoluted :)

Thank you!

Esteban A. Maringolo


More information about the seaside mailing list