Last active
December 12, 2015 03:58
-
-
Save gonzaloruizdevilla/4710409 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var moduleA = function () { | |
return { | |
data: dataArrayObject, | |
init: function () { | |
this.addTable(); | |
this.addEvents(); | |
}, | |
addTable: function () { | |
for (var i = 0; i < rows; i++) { | |
$tr = $('<tr></tr>'); | |
for (var j = 0; j < this.data.length; j++) { | |
$tr.append('<td>' + this.data[j]['id'] + '</td>'); | |
} | |
$tr.appendTo($tbody); | |
} | |
}, | |
addEvents: function () { | |
$('table td').on('click', function () { | |
$(this).toggleClass('active'); | |
}); | |
} | |
}; | |
}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment