05-11-2012 10:39 AM
var oButton = new YAHOO.widget.Button({
id: "copy-button",
type: "button",
label: "Copy",
container: "someelement"
});
alert("oButton===>"+oButton);
05-12-2012 04:19 AM
onReady()
{
this.widgets.copyButton = Alfresco.util.createYUIButton(this, "copy-button", this.onCopyClick);
….
…
},
onCopyClick: Search_onCopyClick()
{
//copy code goes here
},
<span class="yui-button yui-push-button" id="${el}-copy-button">
<span class="first-child"><button>${msg("button.copy")}</button></span>
</span>
05-14-2012 04:23 AM
if (dataType === "document")
{
var viewUrl = Alfresco.constants.PROXY_URI_RELATIVE + "api/node/content/" + oRecord.getData("nodeRef").replace(":/", "") + "/" + oRecord.getData("name");
//var oButton = new YAHOO.widget.Button({ label: "Copy!", onclick: { fn: onButtonClick } });
//var copyButton = Alfresco.util.createYUIButton(this, "copy-button", this.onCopyClick);
//alert("viewUrl—>"+viewUrl);
html = '<div class="action-overlay">' +
'<a href="' + encodeURI(viewUrl) + '" target="_blank"><img title="' + $html(me.msg("label.viewinbrowser")) +
'" src="' + Alfresco.constants.URL_RESCONTEXT + 'components/search/images/view-in-browser-16.png" width="16" height="16"/></a>' +
'<a href="' + encodeURI(viewUrl + "?a=true") + '" style="padding-left:4px" target="_blank"><img title="' + $html(me.msg("label.download")) +
'" src="' + Alfresco.constants.URL_RESCONTEXT + 'components/search/images/download-16.png" width="16" height="16"/></a>' +
'<div id="buttoncontainer"></div>' +
'</div>' + html;
alert("HTML===>"+html);
}
<script type="text/javascript">//<![CDATA[
new Alfresco.Search("${el}").setOptions(
{
siteId: "${siteId}",
siteTitle: "${siteTitle?js_string}",
initialSearchTerm: "${searchTerm?js_string}",
initialSearchTag: "${searchTag?js_string}",
initialSearchAllSites: ${searchAllSites?string},
initialSearchRepository: ${searchRepo?string},
initialSort: "${searchSort?js_string}",
searchQuery: "${searchQuery?js_string}",
minSearchTermLength: ${args.minSearchTermLength!searchconfig.getChildValue('min-search-term-length')},
maxSearchResults: ${args.maxSearchResults!searchconfig.getChildValue('max-search-results')}
}).setMessages(
${messages}
);
new YAHOO.widget.Button({
id: "copy-button",
type: "button",
label: "Copy",
container: "buttoncontainer"
});
//]]></script>
05-14-2012 06:28 AM
html = '<div class="action-overlay">' +
'<a href="' + encodeURI(viewUrl) + '" target="_blank"><img title="' + $html(me.msg("label.viewinbrowser")) +
'" src="' + Alfresco.constants.URL_RESCONTEXT + 'components/search/images/view-in-browser-16.png" width="16" height="16"/></a>' +
'<a href="' + encodeURI(viewUrl + "?a=true") + '" style="padding-left:4px" target="_blank"><img title="' + $html(me.msg("label.download")) +
'" src="' + Alfresco.constants.URL_RESCONTEXT + 'components/search/images/download-16.png" width="16" height="16"/></a>' +
'<span class="yui-button yui-push-button" id="copy-button">' +
'<span class="first-child"><button>Copia</button></span> ' +
'</span>' +
'</div>' + html;
alert("HTML===>"+html);
//Copy YUI button
this.widgets.copyButton = Alfresco.util.createYUIButton(this, "copy-button", this.onCopyClick);
onCopyClick: function Search_onCopyClick()
{
alert("HELLO");
},
05-15-2012 04:10 AM
05-21-2012 03:54 AM
renderCellCopy = function Search_renderCellCopy(elCell, oRecord, oColumn, oData)
{
Dom.setStyle(elCell.parentNode, "width", oColumn.width + "px");
Dom.setStyle(elCell, "height", oColumn.height + "px");
Dom.addClass(elCell, "copy-cell");
html = ' <span id="pushbutton" class="yui-button"><button type="button">Copy</button></span>';
//html = '<div id="bcontainer"> </div>';
elCell.innerHTML = html;
YAHOO.util.Event.addListener("pushbutton", "click", this.onCopyClick,this);
};
onCopyClick: function Search_onCopyClick(obj)
{
alert("HELLO");
},
01-18-2014 11:49 AM
new YAHOO.widget.Button
part) fires too early - before the results are in. So there is no DOM element, so your button can't get attached to anything.var buttonsArray = YAHOO.util.Selector('.copy-button')
and then init a listener on each of those. Or, don't add the element as an innerHTML thing - add it as a real DOM element. Ie in your renderCellCopy, you create a new button and then attach a listener to it. Like this:
…
var buttonEl = document.createElement('button');
buttonEl.setAttribute('id', 'something_unique_here_ie_from_oRecord');
..
// now make this a button or something:
var myButton = new YAHOO.widget.Button(buttonEl, buttonConfigObject);
…
// then attach it to child element
elCell.appendChild(buttonEl);
01-16-2014 05:01 PM
(function()
{
Alfresco.doclib.Actions.prototype.onActionLinkTo = function dlA_onActionLinkTo(record, owner)
{
// Get action & params and start create the config for displayForm
var action = this.getAction(record, owner),
params = action.params,
config =
{
title: this.msg(action.label)
},
displayName = record.displayName;
// Make sure we don't pass the function as a form parameter
delete params["function"];
if (!this.modules.linkTo) {
this.modules.linkTo = new Alfresco.module.DoclibGlobalFolder(this.id + "-linkTo");
}
this.modules.linkTo.setOptions(
{
allowedViewModes: [
Alfresco.module.DoclibGlobalFolder.VIEW_MODE_SITE,
Alfresco.module.DoclibGlobalFolder.VIEW_MODE_REPOSITORY,
Alfresco.module.DoclibGlobalFolder.VIEW_MODE_USERHOME
],
title: "Link " + record.fileName + " to…",
siteId: this.options.siteId,
containerId: this.options.containerId,
path: this.currentPath,
files: record,
rootNode: this.options.rootNode,
parentId: this.getParentNodeRef(record)
}).showDialog();
YAHOO.Bubbling.on("folderSelected", this.onFolderSelected, this.modules.linkTo);
};
Alfresco.doclib.Actions.prototype.onFolderSelected = function linkFolder_onFolderSelected(event, args)
{
Alfresco.logger.info("— event : " + event);
}
})();
01-18-2014 11:51 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.