Before I explain why I'd like to do this, I'd better get to the question.
That is, using the built-in AJAX framework, is it possible to update an element's InnerHTML by appending the contents of a partial, rather than simply overwriting the InnerHTML?
For example, if I have a div:
<div id="update_me"><span>Contents</span></div>
And had called sendRequest like so:
$(this).getForm().sendRequest('append_to_div',
{update: {'update_me': 'some_partial'}}
)"Would I be able to append the contents of 'some_partial' to the end of the div (after the span)? Or will I have to make jQuery/Mootools AJAX functions to do this?
Being able to update by appending like this would be particularly useful for adding extra rows to a table element without having to reload the contents of the entire table. If I have 50 products in the table, each in its own row, I'd like to be make an AJAX request that would add the next 50 products to the table without having to load the first 50 from again.
As I'm new to AJAX, I'd like to keep things as simple as possible. But if I need to make custom AJAX functions in a javascript library in order to do this, I should start looking into those more.
As an afterthought, is there a way I can create my own handlers for the sendRequest method without having to put them in the AJAX section of the page in the admin area? I'd like to be able to define all my custom handlers in a file inside my module and access them from any page. Would that be in the module information file?

Help













