Forráskód Böngészése

HUE-214. Add ability to load portions of a tree-view table via ajax.

In my refactoring I missed a few things:
* the pstree demo still referred to the renamed r method
* my refactored linkers for the ajax loader was missing brackets and a call to addGlobalLinkers
Aaron Newton 15 éve
szülő
commit
c44c648f46

+ 5 - 2
apps/jframegallery/src/jframegallery/templates/html-table.treeview.ajax.mako

@@ -45,8 +45,11 @@
           expanded = ""
           if path in open_paths:
             expanded = "table-expanded"
+          folder = ""
+          if node.children:
+            folder = "table-folder"
         %>
-        <tr class="table-folder table-depth-${depth} ${expanded} pstree-${node.pid}">
+        <tr class="${folder} table-depth-${depth} ${expanded} pstree-${node.pid}">
           <td style="max-width:400px">
             % if path in open_paths:
               <a href="${remove(path)}" class="ccs-hidden">collapse</a>
@@ -68,7 +71,7 @@
         </tr>
         % if path in open_paths or show_all:
           % for child in node.children:
-            ${r(child, depth+1, path+"/"+str(child.pid))}
+            ${create_row(child, depth+1, path+"/"+str(child.pid))}
           % endfor
         % elif not show_all and len(node.children) > 0:
           <tr style="display:none" class="html-table-tree-ignore pstree-${node.pid}-target"><td colspan="4"></td></tr>

+ 2 - 1
desktop/core/static/js/Source/JFrameLinkers/CCS.JFrame.AjaxLoad.js

@@ -44,7 +44,7 @@ script: CCS.JFrame.AjaxLoad.js
 
 	['append', 'replace', 'target'].each(function(action){
 
-		linkers['data-ajax-' + action] = function(event, link){
+		linkers['[data-ajax-' + action + ']'] = function(event, link){
 			var target = $(this).getElement(link.get('data', 'ajax-' + action));
 			if (!target) {
 				link.erase('data-ajax-' + action);
@@ -100,5 +100,6 @@ script: CCS.JFrame.AjaxLoad.js
 			this.load(options);
 		};
 	});
+	CCS.JFrame.addGlobalLinkers(linkers);
 
 })();