Binding Javascript Callbacks
If you wish to add any sort of Javascript-powered functionality to your celltype, you can do it using Matrix.bind(). This is necessary (as opposed to simply calling a function on page load) because Matrix rows are created, sorted, and deleted on-the-fly.
Matrix.bind('fieldtype_class', 'event_name', function(cell){
// custom code here
});
Events
Matrix supports the following events:
display- Called for each cell present on page load, and each cell created afterwards
beforeSort- Called right before a row begins to be sorted
afterSort- Called after sorting has stopped
remove- Called right before a row is removed from the DOM