If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Connect encapsulated code with a jquery plugin

Hello everyone, I have only programmed old-school javascript and I'm not used to the way is it used nowadays (unobtrusive, encapsulated, using objects for everything, etc). So please bear with me if this question seems silly.

This is what I need:

I'm using a jQuery plugin called Flexigrid to create grids to list items. I'm not going to get into this. Just mention that I have configured these buttons in it (notice the callbacks):

Logically, the callbacks will not work because item is encapsulated. How would you do this to prevent collisions? You might say join both snippets within the same closure. Problem is that I need the first one to be output from a template because it depends on PHP variables, whereas the second one is in a js file.