[Cropper Library] Can't set options

Forge Component
(5)
Published on 2019-10-02 by Labs
5 votes
Published on 2019-10-02 by Labs

Hi,

If I add any options I have an error when calling the cropper

JSON Parse error: Expected '}'




Even if I put "{aspectRatio: 1}" in Options...

What is a proper syntax for this?


PS: I use it in v10 mobile app with phone theme.


Thank you,

Nick



Solution

Hi Mykola,

Have you tried like this:  "{"viewMode":3,"aspectRatio":"1/1"}"   ?
Try it on an online json formatter and validator.

Regards

Solution

Hi Franisco,

Yes it works with double-double-quotes as it is a an expression field: 

"{""aspectRatio"":1,""viewMode"":1, ""scalable"":false}"

Thanks 

Hi,

How to fix the fixed cropboxwidth & height,(not max & min size)

Hi,

We're having some problems setting the initial size of the cropper guides.

What is the correct syntax of adding this setting on the Options input parameter?

We've tried something like:


""ready"": function () {
$toCrop.cropper(""setCropBoxData"", { width: 50, height: 50 });
}


but we're getting an error from the JSON parser.

How can we workaround this issue?

Thank you very much in advance.

Best regards,

Paulo