Skip to content

Commit

Permalink
Added capability to populate datatable columns with sobject definitio…
Browse files Browse the repository at this point in the history
…n based labels

Added more output to the errorRenderer
  • Loading branch information
rob-baillie-ortoo committed Mar 31, 2022
1 parent 868890c commit f034717
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const checkColumnProperty = function( functionName, object, columnsPropertyName
}
}


const refreshConfiguration = function( columnsPropertyName ) {

checkColumnProperty( 'refreshConfiguration', this, columnsPropertyName );
Expand Down Expand Up @@ -53,7 +52,21 @@ const configureSortableFields = function( columnsPropertyName, fields, error ) {
}
}

const configureLabelsBasedOnSobjectDefinition = function( columnsPropertyName, sobjectDefinition )
{
checkColumnProperty( 'configureLabelsBasedOnSobjectDefinition', this, columnsPropertyName );

if ( sobjectDefinition ) {
this[columnsPropertyName].forEach( thisColumn => {
( thisColumn.labelSobject == sobjectDefinition.apiName )
&& ( sobjectDefinition.fields[ thisColumn.labelSobjectField ] )
&& ( thisColumn.label = sobjectDefinition.fields[ thisColumn.labelSobjectField ].label );
});
}
}

export default {
refreshConfiguration : refreshConfiguration,
configureSortableFields : configureSortableFields
configureSortableFields : configureSortableFields,
configureLabelsBasedOnSobjectDefinition : configureLabelsBasedOnSobjectDefinition,
};

0 comments on commit f034717

Please sign in to comment.