Skip to main content
Nintex Community Menu Bar
Question

Task Subject Field Accepting Custom Field Renderer

  • July 9, 2024
  • 9 replies
  • 13 views

Forum|alt.badge.img+20

Uncaught TypeError: Cannot read property ‘0’ of null           skuid__SkuidJS:26



9 replies

Forum|alt.badge.img+11

Hey Pat, since this looks like it’s pretty specific, do you think you could open the dev tools, click on the console, and then give us a screenshot of the errors that come up when you refresh the page with the custom field rendered applied to the field that is breaking it.


Forum|alt.badge.img+20
  • Author
  • Scholar
  • 2847 replies
  • July 9, 2024


Forum|alt.badge.img+8
  • 649 replies
  • July 9, 2024

Subject is a weird field.  It has a display type of COMBOBOX which skuid does not have a renderer for.

Try adding this line above the renderer code.

var displayTypeToUse;<br>if (field.metadata.displaytype === 'COMBOBOX') {<br>&nbsp; &nbsp; displayTypeToUse = 'TEXT';<br>} else {<br>&nbsp; &nbsp; displayTypeToUse = field.metadata.displaytype;<br>}



Then use displayTypeToUse instead of field.metadata.displaytype.


Forum|alt.badge.img+8
  • 649 replies
  • July 9, 2024

That said, we need to fix Skuid so that your original code would work and not bomb like that.


Forum|alt.badge.img+20
  • Author
  • Scholar
  • 2847 replies
  • July 9, 2024

Still no dice.


Forum|alt.badge.img+8
  • 649 replies
  • July 9, 2024

Can you paste in the exact code you’re trying?  I’ll try it on the same field.


Forum|alt.badge.img+20
  • Author
  • Scholar
  • 2847 replies
  • July 9, 2024
var $ = skuid.$, field = arguments[0], value = arguments[1]; if (field.mode === 'read') { field.element.append(skuid.$('<div>').addClass('nx-fieldtext').text(field.model.getFieldValue(field.row,skuid.utils.getFieldReference(field.id,field.metadata)))); } else { skuid.ui.fieldRenderers.TEXT.edit(field,value); }


Forum|alt.badge.img+8
  • 649 replies
  • July 9, 2024

The skuid.utils.getFieldReference() will only work on REFERENCE type fields. For non reference fields, you can just use value to put into the text. Like this…


var $ = skuid.$,    field = arguments[0],
    value = arguments[1];
if (field.mode === 'read') {
    field.element.append(skuid.$('<div>').addClass('nx-fieldtext').text(value));
} else {
    skuid.ui.fieldRenderers.TEXT.edit(field,value);
}

Forum|alt.badge.img+20
  • Author
  • Scholar
  • 2847 replies
  • July 9, 2024

Yup. That was it.