I need to understand this js code snippet which is responsible for calculating the positioning of rows and columns, from a table html, to PDF.
$(el).find('tbody').find('tr').each(function(index,data) {
rowCalc = index+1;
if (rowCalc % 35 == 0){
doc.addPage();
page++;
startRowPosition=startRowPosition+10;
}
rowPosition=(startRowPosition + (rowCalc * 10)) - ((page -1) * 280);
$(this).filter(':visible').find('td').each(function(index,data) {
if ($(this).css('display') != 'none'){
if(defaults.ignoreColumn.indexOf(index) == -1){
var colPosition = startColPosition+ (index * 50);
doc.text(colPosition,rowPosition, parseString($(this)));
}
}
});
});
The biggest puzzle is in:
function (index, data)
I can not understand what this function represents and what and what are the values of the index and date parameters.