Skip to content

Commit 9c45812

Browse files
aaronmiVesaJuvonen
authored andcommitted
Update building-simple-field-customizer.md (SharePoint#971)
Changed onRenderCell() to avoid folder item being rendered as "width: px" which displays full width of the column.
1 parent bae0710 commit 9c45812

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/spfx/extensions/get-started/building-simple-field-customizer.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,14 @@ Now that we have successfully tested the out-of-the-box starting point of the Fi
219219
public onRenderCell(event: IFieldCustomizerCellEventParameters): void {
220220
221221
event.domElement.classList.add(styles.cell);
222-
event.domElement.innerHTML = `
222+
if (typeof event.fieldValue != 'undefined' && event.fieldValue) { // for folder fieldValue is "".
223+
event.domElement.innerHTML = `
223224
<div class='${styles.full}'>
224225
<div style='width: ${event.fieldValue}px; background:#0094ff; color:#c0c0c0'>
225226
&nbsp; ${event.fieldValue}
226227
</div>
227228
</div>`;
229+
}
228230
}
229231
```
230232

0 commit comments

Comments
 (0)