//This is the function that will run every time a new item is added or the
//list is sorted.
var showNewOrder = function() {
//This function means we get serialize() to tell us the text of each
//element, instead of its ID, which is the default return.
var serializeFunction = function(el) { return el.get('text'); };
//We pass our custom function to serialize();
var orderTxt = sort.serialize(serializeFunction);
//And then we add that text to our page so everyone can see it.
$('data').set('text', orderTxt.join(' '));
};
full code is at http://demos.mootools.net/Dynamic.Sortables
var serializeFunction = function(*el*) { return el.get('text'); };
var orderTxt = sort.serialize(serializeFunction*(el)*);
compare the codes
is el being passed or not? what is going on???
I want to learn advanced parameter usage.
If not declaring functions like "function name(parameter1, parameter2, parameter3...)". If not calling functions like "name(parameter1, parameter2, parameter3...)". If parameters aren't variables.
If declaring functions like "function(parameter1, parameter2, parameter3...)". If calling functions like "variable(parameter1, parameter2, parameter3...)". If parameters are objects.
I'm interested.
You probably have a bookmark with the lessons in which I'm interested... please, share!!!