We currently have a grid that contains some columns that have notes, these notes vary in length and the user has to constantly adjust the field margin. or maybe a way to word wrap.. i am open to ideas.
Announcement
Collapse
No announcement yet.
hover over grid field to see all contents, or a better idea.
Collapse
X
-
In a grid column, you can enable text wrapping via the formatting options "Wrap Cell";
Screenshot 2024-05-10 at 10.03.26 AM.png
-
on some of my fields i have custom formatting
return v.substr(2,v.length); I am doing a sub string so the first 2 positions dont show on the grid (using for setting the field color)...i loose my custom formatting when i have the text wrap on... is there a way to do this in the custom formatting... or...
Comment
-
Instead of implementing white-space style, you would have to apply logic to insert a break after every 50 characters
Example:
Code:const wrapByNbrChars = function(text, maxChars) { let wrappedText = ''; for (let i = 0; i < text.length; i += maxChars) { wrappedText += `${text.substring(i, i + maxChars)}<br>`; } return wrappedText; }; return wrapByNbrChars(v, 50);
Comment
-
i have a note about 150 characters... when it comes into here...v = the first 50 characters, and the length = 49
debugger;
console.log(v, v.length);
const wrapByNbrChars = function(text, maxChars) {
let wrappedText = '';
for (let i = 0; i < text.length; i += maxChars) {
wrappedText += `${text.substring(i, i + maxChars)}<br>`;
}
return wrappedText;
};
return wrapByNbrChars(v, 50);
Comment

Comment