Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $(':checkbox').click(function() {
- var row = $(this).parent().parent().parent().parent();
- alert($(row).html());
- isFinished(row);
- });
- $(document).ready(function () {
- $('#MainContent_ctl00_listItemsTable tr').each(function () {
- changeColorOfRow(this);
- isFinished(this);
- });
- });
- function isFinished(row) {
- if ($(row).attr('data-finished') == 'True') {
- $(row).find('td p').css('text-decoration', 'line-through');
- } else {
- $(row).find('td p').css('text-decoration', '');
- }
- }
- function changeColorOfRow(row) {
- var priority = $(row).attr('data-priority');
- if (priority == 0) {
- $($(row).find('td')).each(function () {
- determineColor(this, 'red');
- });
- }
- if (priority == 1) {
- $($(row).find('td')).each(function () {
- determineColor(this, 'yellow');
- });
- }
- if (priority == 2) {
- $($(row).find('td')).each(function () {
- determineColor(this, 'blue');
- });
- }
- if (priority == 3) {
- $($(row).find('td')).each(function () {
- determineColor(this, 'blue');
- });
- }
- if (priority == 5) {
- $($(row).find('td')).each(function () {
- determineColor(this, 'green');
- });
- }
- if (priority == 6) {
- $($(row).find('td')).each(function () {
- determineColor(this, 'purple');
- });
- }
- }
- function determineColor(column, color) {
- $(column).css('background-color', color);
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement