| | |
| | | */ |
| | | init_row: function(row) |
| | | { |
| | | // make references in internal array and set event handlers |
| | | if (row && String(row.id).match(this.id_regexp)) { |
| | | var self = this, |
| | | uid = RegExp.$1; |
| | | var uid; |
| | | if (row && (uid = $(row).data('uid'))) |
| | | row.uid = uid; |
| | | else if (row && String(row.id).match(this.id_regexp)) |
| | | row.uid = RegExp.$1; |
| | | |
| | | // make references in internal array and set event handlers |
| | | if (row && row.uid) { |
| | | var self = this, uid = row.uid; |
| | | this.rows[uid] = {uid:uid, id:row.id, obj:row}; |
| | | |
| | | // set eventhandlers to table row |
| | |
| | | if (row.id) domrow.id = row.id; |
| | | if (row.className) domrow.className = row.className; |
| | | if (row.style) $.extend(domrow.style, row.style); |
| | | if (row.uid) $(domrow).data('uid', row.uid); |
| | | |
| | | for (var domcell, col, i=0; row.cols && i < row.cols.length; i++) { |
| | | col = row.cols[i]; |
| | |
| | | row.expanded = true; |
| | | depth = row.depth; |
| | | new_row = row.obj.nextSibling; |
| | | this.update_expando(row.uid, true); |
| | | this.update_expando(row.id, true); |
| | | this.triggerEvent('expandcollapse', { uid:row.uid, expanded:row.expanded, obj:row.obj }); |
| | | } |
| | | else { |
| | |
| | | row.expanded = false; |
| | | depth = row.depth; |
| | | new_row = row.obj.nextSibling; |
| | | this.update_expando(row.uid); |
| | | this.update_expando(row.id); |
| | | this.triggerEvent('expandcollapse', { uid:row.uid, expanded:row.expanded, obj:row.obj }); |
| | | |
| | | // don't collapse sub-root tree in multiexpand mode |
| | |
| | | $(new_row).css('display', 'none'); |
| | | if (r.has_children && r.expanded) { |
| | | r.expanded = false; |
| | | this.update_expando(r.uid, false); |
| | | this.update_expando(r.id, false); |
| | | this.triggerEvent('expandcollapse', { uid:r.uid, expanded:r.expanded, obj:new_row }); |
| | | } |
| | | } |
| | |
| | | row.expanded = true; |
| | | depth = row.depth; |
| | | new_row = row.obj.nextSibling; |
| | | this.update_expando(row.uid, true); |
| | | this.update_expando(row.id, true); |
| | | this.triggerEvent('expandcollapse', { uid:row.uid, expanded:row.expanded, obj:row.obj }); |
| | | } |
| | | else { |
| | |
| | | $(new_row).css('display', ''); |
| | | if (r.has_children && !r.expanded) { |
| | | r.expanded = true; |
| | | this.update_expando(r.uid, true); |
| | | this.update_expando(r.id, true); |
| | | this.triggerEvent('expandcollapse', { uid:r.uid, expanded:r.expanded, obj:new_row }); |
| | | } |
| | | } |
| | |
| | | }, |
| | | |
| | | |
| | | update_expando: function(uid, expanded) |
| | | update_expando: function(id, expanded) |
| | | { |
| | | var expando = document.getElementById('rcmexpando' + uid); |
| | | var expando = document.getElementById('rcmexpando' + id); |
| | | if (expando) |
| | | expando.className = expanded ? 'expanded' : 'collapsed'; |
| | | }, |
| | |
| | | this.collapse(selected_row); |
| | | } |
| | | |
| | | this.update_expando(selected_row.uid, selected_row.expanded); |
| | | this.update_expando(selected_row.id, selected_row.expanded); |
| | | |
| | | return false; |
| | | } |