Skip to main content
Nintex Community Menu Bar

Enjoy!


(function(skuid) { /* ========== Custom field type-specific renderers here ========== / var $ = skuid.$; function defaults(field){ $(field.element).dblclick(function(e) { e.stopImmediatePropagation(); return false; }); $(‘a’,field.element).attr(“target”, “_blank”); } function customBoolRenderer(ogRenderer, mode, field, value) { // To call original renderer ogRenderer.apply(this, Array.prototype.slice.call(arguments, 2)); defaults(field); } function customComboRenderer(ogRenderer, mode, field, value) { // To call original renderer ogRenderer.apply(this, Array.prototype.slice.call(arguments, 2)); defaults(field); } function customCurRenderer(ogRenderer, mode, field, value) { // To call original renderer ogRenderer.apply(this, Array.prototype.slice.call(arguments, 2)); defaults(field); } function customDateRenderer(ogRenderer, mode, field, value) { // To call original renderer ogRenderer.apply(this, Array.prototype.slice.call(arguments, 2)); defaults(field); } function customDTimeRenderer(ogRenderer, mode, field, value) { // To call original renderer ogRenderer.apply(this, Array.prototype.slice.call(arguments, 2)); defaults(field); } function customDblRenderer(ogRenderer, mode, field, value) { // To call original renderer ogRenderer.apply(this, Array.prototype.slice.call(arguments, 2)); defaults(field); } function customEmailRenderer(ogRenderer, mode, field, value) { // To call original renderer ogRenderer.apply(this, Array.prototype.slice.call(arguments, 2)); defaults(field); } function customFileRenderer(ogRenderer, mode, field, value) { // To call original renderer ogRenderer.apply(this, Array.prototype.slice.call(arguments, 2)); defaults(field); } function customIdRenderer(ogRenderer, mode, field, value) { // To call original renderer ogRenderer.apply(this, Array.prototype.slice.call(arguments, 2)); defaults(field); } function customIntRenderer(ogRenderer, mode, field, value) { // To call original renderer ogRenderer.apply(this, Array.prototype.slice.call(arguments, 2)); defaults(field); } function customMplRenderer(ogRenderer, mode, field, value) { // To call original renderer ogRenderer.apply(this, Array.prototype.slice.call(arguments, 2)); defaults(field); } function customPercRenderer(ogRenderer, mode, field, value) { // To call original renderer ogRenderer.apply(this, Array.prototype.slice.call(arguments, 2)); defaults(field); } function customPhoneRenderer(ogRenderer, mode, field, value) { // To call original renderer ogRenderer.apply(this, Array.prototype.slice.call(arguments, 2)); defaults(field); } function customPlRenderer(ogRenderer, mode, field, value) { // To call original renderer ogRenderer.apply(this, Array.prototype.slice.call(arguments, 2)); defaults(field); } function customRefRenderer(ogRenderer, mode, field, value) { // To call original renderer ogRenderer.apply(this, Array.prototype.slice.call(arguments, 2)); defaults(field); } function customStrRenderer(ogRenderer, mode, field, value) { // To call original renderer ogRenderer.apply(this, Array.prototype.slice.call(arguments, 2)); defaults(field); } function customTextRenderer(ogRenderer, mode, field, value) { // To call original renderer ogRenderer.apply(this, Array.prototype.slice.call(arguments, 2)); defaults(field); } function customTAreaRenderer(ogRenderer, mode, field, value) { // To call original renderer ogRenderer.apply(this, Array.prototype.slice.call(arguments, 2)); defaults(field); } // Add custom renderers to the map below to be injected const customRenderMap = { // Format of TYPE: functionName, where TYPE is the field type in the original Skuid map BOOLEAN: customBoolRenderer, COMBOBOX: customComboRenderer, CURRENCY: customCurRenderer, DATE: customDateRenderer, DATETIME: customDTimeRenderer, DOUBLE: customDblRenderer, EMAIL: customEmailRenderer, FILE: customFileRenderer, ID: customIdRenderer, INTEGER: customIntRenderer, MULTIPICKLIST: customMplRenderer, PERCENT: customPercRenderer, PHONE: customPhoneRenderer, PICKLIST: customPlRenderer, REFERENCE: customRefRenderer, STRING: customStrRenderer, TEXT: customTextRenderer, TEXTAREA: customTAreaRenderer }; / ========== Supporting code ==================================== / const origRenderMap = {}; function ParamInjector(func) { let args = Array.prototype.slice.call(arguments, 1); return function() { return func.apply(this, args.concat(Array.prototype.slice.call(arguments))); }; } / ========== Main =============================================== */ // Store and then replace skuid renderers Object.keys(customRenderMap).forEach(fieldType => { origRenderMaprfieldType] = {}; Object.keys(skuid.ui.fieldRenderersefieldType]).forEach((fieldMode) => { origRenderMaprfieldType]pfieldMode] = skuid.ui.fieldRenderersefieldType]sfieldMode]; skuid.ui.fieldRenderersefieldType]sfieldMode] = ParamInjector(function(mode, field, value) { customRenderMaptfieldType].apply(this, aorigRenderMaprfieldType]pfieldMode]].concat(Array.prototype.slice.call(arguments))); }, fieldMode); }); }); })(skuid);

I Like this.


Pat, would you share a little bit about what problem you are solving with this? And how you’ve solved it in this case?