| 12345678910111213141516171819202122232425262728293031323334 |
- // @require p5Utils__format
- // @require variables:
- // if ('undefined' === typeof UNIQ_HASH) throw "Missing UNIQ_HASH"; // $this->_htmlID
- var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
- var defaultsProps = {
- ico: true,
- label: false
- };
- var props = jQuery.extend({}, defaultsProps, props);
- var funcNode = $('<a href="#" style="margin:0 2px;"></a>');
- if ('href' in funObj) funcNode.attr('href', p5Utils__format(funObj.href, [rowPK]));
- if (props.ico) {
- if ('ico' in funObj) funcNode.append('<span class="' + funObj.ico + '"></span>');
- }
- if ('onclick' in funObj) funcNode.attr('onclick', p5Utils__format(funObj.onclick, [rowPK]));
- if ('title' in funObj) funcNode.attr('title', funObj.title);
- if ('target' in funObj) funcNode.attr('target', funObj.target);
- if (props.label) {
- if ('label' in funObj) {
- funcNode.append(' ' + funObj.label);
- } else if ('title' in funObj) {
- funcNode.append(' ' + funObj.title);
- }
- }
- return funcNode;
- };
- global['p5UI_TableAjax_generateFunctionNode'] = p5UI_TableAjax_generateFunctionNode
|