One Skuid for View and New Record

  • 1
  • Idea
  • Updated 2 years ago



var $ = skuid.$,
    field = arguments[0],
    hasChanged = field.model.changes[field.row.Id] && field.model.changes[field.row.Id][field.id];

switch(field.mode) {
    case 'read':
        if (field.row.Id.length >= 15 && !hasChanged) {
            skuid.ui.fieldRenderers[field.metadata.displaytype].read(field, arguments[1]);
        } else {
            skuid.ui.fieldRenderers[field.metadata.displaytype].edit(field, arguments[1]);
        }
        break;
    
    case 'readonly':
        skuid.ui.fieldRenderers[field.metadata.displaytype].read(field, arguments[1]);
        break;
    
    case 'edit':
        skuid.ui.fieldRenderers[field.metadata.displaytype].edit(field, arguments[1]);

}
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb

Posted 2 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
This time with the right screen being recorded. ;)

Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,260 Points 5k badge 2x thumb
Pat~

Thanks for sharing that snippet with the community :)

Karen