Form.Request.Append and filter..

6 views
Skip to first unread message

ragra

unread,
Nov 20, 2011, 2:53:03 AM11/20/11
to Clientcide
I was trying to use Form.Request.Append through and adapted
Behavior.FormRequest called Behavior.MyFormRequestAppend (where I
simply created a Form.Request.Append opbject instead of the normal
Form.Request object as in Behavior.FormRequest) togtether with filter,
but unfortunately it seems like filter's doesn't work out of the box
with Form.Request.Append. (because of success mothod on Request.HTML)
I can make a modification my self, called something like
Form.Request.MyAppend where I modify the onSuccess to make the wanted
behavior - which is, the ability to use Behavior.FormRequest where I
append the filtered result. But to me it seems dirty to c/p the native
Form.Request.Append, make a new class based on that and then override
the the onSuccess method. Is there any other way elegant way around
this problem (which I haven't thought about) and would you considder
putting in a Behavior.FormRequestAppend in Clientside as well ?
Cheers
Rasmus

Aaron Newton

unread,
Nov 20, 2011, 4:46:05 PM11/20/11
to clien...@googlegroups.com
1) I'd file a ticket on More for the fact that filter isn't observed in this class.

2) you can still fix this without overwriting the class. Add an onSuccess event to your Form.Request.Append which is passed the container element that gets injected. Run your filter there:

var req = new Form.Request.Append(element, updateElement, {
  ...
  onSuccess: function(container){ container.adopt(container.getElements(THEFILTER)); }
});

something like that.


--
You received this message because you are subscribed to the Google Groups "Clientcide" group.
To post to this group, send email to clien...@googlegroups.com.
To unsubscribe from this group, send email to clientside+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/clientside?hl=en.


ragra

unread,
Nov 23, 2011, 7:06:49 AM11/23/11
to Clientcide
Thanks for tip - got it working by doing pretty much like that :)
Reply all
Reply to author
Forward
0 new messages