Re: Other parameters on InPlaceEditor

Christophe Porteneuve
Tue, 10 Jul 2007 14:43:37 -0000

Hey,

Use the callback option, which works like Ajax.Autocompleter''s: you
specify a function of yours that will take two arguments: the form
element created for IPE and the editable field''s value.  It''s
in charge
of returning the serialized parameters.  The default implementation just
does:

   callback: function(form) { return Form.serialize(form); }

You can use that to bind in your own stuff, like:

   callback: function(form, value) {
     var data = Form.serialize(form, true);
     data.merge({ myParam1: value1, myParam2, value2 /*...*/ });
     return data.toQueryString();
   }

Or if you''re more into serialized forms already (which means you take
care of URL-encoding yourself, ugh):

   callback: function(form, value) {
     return Form.serialize(form) +
''myParam1=value1&myParam2=value2'';
   }

(Obviously here, we don''t URl-encode anything, but you may need to).

''HTH