Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var color = '';
- function changeColor(obj) {
- var rowObject = getParentRow(obj);
- var parentTable = document.getElementById("gvCategories");
- if(color == ''){
- color = getRowColor();
- }
- if(obj.checked){
- rowObject.style.backgroundColor = 'Yellow';
- }
- else{
- rowObject.style.backgroundColor = color;
- color = '';
- }
- // private method
- function getRowColor(){
- if(rowObject.style.backgroundColor == '') return parentTable.style.backgroundColor;
- else return rowObject.style.backgroundColor;
- }
- }
- // This method returns the parent row of the object
- function getParentRow(obj){
- do{
- obj = obj.parentElement;
- }
- while(obj.tagName != "TR")
- return obj;
- }
- function highlightRow(object) {
- if ($(object).attr("checked") == true) {
- alert('is checked!'); // this will fire
- $(object).parent('tr').addClass("highlightedRow");
- }
- else {
- alert('is not checked!');
- $(object).parent('tr').removeClass("highlightedRow");
- }
- }
- $(document).ready( function() {
- $('.rowCheckbox').click( function() {
- if (this.checked) {
- $(this).parent('tr').addClass('highlight');
- }
- else {
- $(this).parent('tr').removeClass('highlight');
- }
- });
- });
- $(this).parents('tr').addClass('highlight');
- $(object).parent('tr')
- .addClass('highlight');
- .SpatialDataHighlightedRow {
- background-color: #DDDDDD !important;
- }
Add Comment
Please, Sign In to add comment