I am currently making a component to set a table dynamically based on a dialog. The problem I am facing is that one of the requirements is "the editor be able to set the width of each column in the dialog", the dialog is already made, and I am showing and hidding the field of columnd width based on the size of the field of Column quantitys, but I would like to change the max of the numberfield based on the somatory with jquery. Is It possible, have someone of you guys made it before?
Solved! Go to Solution.
Check out the max value on the NumberField:
NumberField — Granite UI 1.0 documentation
Also- when ever the OOTB granite data types do not meet your needs - you can build a custom Sling Resource type using JQuery plug-in. This is shown in this article -where we make a color picker and add the color picker to a component dialog.
YOu need to get the width of the table from the component dialog?
Views
Replies
Total Likes
I know It sounds "funny", but that is the client requirement, so... What I've done created the js for showing and hiding the columns width(numberfields) and a validation.js in order to only able the editor to submit the dialog if the total width is <= 100, that was done by using a clientlibrary with categories[cq.authoring.dialog] . So I used the use api to retreive that data and put a styles variable in a input type="hidden", after that I created a js in a secondary clientlibrary destinated to the clientSide and in that js I created the css classes dynamically. My requirement is done.
Still... I would like to know how could I change the max attribute of a numberfield, I was trying to do that, but I was not able to know what I should change in the granite numberField that I was getting with jquery selecting a class that I had assigned to each numberfield. Anyway, I already made the component, but I would like to know if you guys have ever made something like that and if yes let me know how, thanks.
Views
Replies
Total Likes
Check out the max value on the NumberField:
NumberField — Granite UI 1.0 documentation
Also- when ever the OOTB granite data types do not meet your needs - you can build a custom Sling Resource type using JQuery plug-in. This is shown in this article -where we make a color picker and add the color picker to a component dialog.
Thanks, If I have a evolution I will share with you guys.
Views
Replies
Total Likes
that would be great!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies