소스 검색

HUE-242. Change HtmlTable TreeView code to deal with Partial Refresh's new feature of removing nodes missing from the response

Aaron Newton 15 년 전
부모
커밋
83c84bdbe4
1개의 변경된 파일4개의 추가작업 그리고 7개의 파일을 삭제
  1. 4 7
      desktop/core/static/js/Source/BehaviorFilters/Behavior.HtmlTableLiveTreeKeyboard.js

+ 4 - 7
desktop/core/static/js/Source/BehaviorFilters/Behavior.HtmlTableLiveTreeKeyboard.js

@@ -35,18 +35,15 @@ var checkLinkerForLivePath = function(anchor, methods){
 Behavior.addGlobalPlugin('HtmlTable', 'HtmlTableLiveTreeKeyboard', function(element, methods){
 	if (!element.hasClass('treeView')) return;
 	var table = element.retrieve('HtmlTable');
+	table.addEvent('onHideRow', function(row){
+		if (row.get('data-partial-line-id')) row.destroy();
+	});
 	table.addEvent('expandSection', function(row){
 		var anchor = row.getElement('.expand');
-		if (!row.retrieve('livetree:loaded')) {
-			row.store('livetree:loaded', true);
-			if (anchor) methods.callClick({ stop: $empty, preventDefault: $empty, stopPropagation: $empty}, anchor, true);
-		} else if (anchor) {
-			checkLinkerForLivePath(anchor, methods);
-		}
+		if (anchor) methods.callClick({ stop: $empty, preventDefault: $empty, stopPropagation: $empty}, anchor, true);
 	}.bind(this));
 	table.addEvent('closeSection', function(row){
 		var anchor = row.getElement('.expand');
-		row.store('livetree:loaded', true);
 		if (anchor) checkLinkerForLivePath(anchor, methods);
 	});
 	$(table).addEvent('click:relay(.expand)', function(event, link){