Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. function registerCustomRenderers(customRenderers, customProperties) {
  2. if (Alfresco.DocumentList) {
  3.  
  4. for (var i = 0; i < customRenderers.length; i++) {
  5. var customRenderer = customRenderers[i];
  6. var customProperty = customProperties[i];
  7.  
  8. YAHOO.Bubbling.fire("registerRenderer", {
  9. propertyName : customRenderer,
  10. renderer : function (record,
  11. label) {
  12. var jsNode = record.jsNode, properties = jsNode.properties, html = "";
  13.  
  14. var oData = properties[customProperty];
  15.  
  16. if (!oData)
  17. return html;
  18.  
  19. var valor = Alfresco.util.formatDate(
  20. Alfresco.util
  21. .fromISO8601(oData.iso8601),
  22. "dd/mm/yyyy");
  23.  
  24. html = '<span class="item">' + label + valor
  25. + '</span>';
  26.  
  27. return html;
  28. }
  29. });
  30. }
  31. }
  32. }
  33.  
  34. (function() {
  35. var $html = Alfresco.util.encodeHTML, $isValueSet = Alfresco.util.isValueSet;
  36.  
  37. var customRenderers = ["dataDocumento", "dataFinalResposta"];
  38. var customProperties = ["dbs:dataDocumento", "dbs:dataFinalResposta"];
  39.  
  40. registerCustomRenderers(customRenderers, customProperties);
  41.  
  42. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement