Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some document builder functions don't work with callCommand #171

Open
lorenzoale opened this issue Aug 10, 2022 · 1 comment
Open

some document builder functions don't work with callCommand #171

lorenzoale opened this issue Aug 10, 2022 · 1 comment
Assignees

Comments

@lorenzoale
Copy link

Do you want to request a feature or report a bug?
feature

What is the current behavior?
some functions availables in the document builder documentation seems to be missing in the callCommand way of using it. For example Select() or Push() to select a content control or push data into it.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

What is the expected behavior?
I would like to select and paste data (text or image) inside a content control or to replace the content control by the data i want to paste (because i want to delete it afterwards anyway). 
I do it with pasteHtml for the moment but it would be nice to be able to do it directly inside the callCommand function. 

Which versions of sdkjs-plugins, and which browser / OS are affected by this issue? Did this work in previous versions of sdkjs-plugins?
OO doc editor version 7.0.1

@l8556
Copy link
Member

l8556 commented Aug 11, 2022

Hi @lorenzoale !
You need to update the document editor to version 7.1.1

An example of using the callCommand function on version 7.1.1 to create a content control and insert text inside it:

        {
            this.callCommand(function () {
                var oDocument = Api.GetDocument();
                var oTextForm = Api.CreateTextForm({
                    "key": "Personal information",
                    "tip": "Enter your first name",
                    "required": true,
                    "placeholder": "First name",
                    "comb": true,
                    "maxCharacters": 10,
                    "cellWidth": 3,
                    "multiLine": false,
                    "autoFit": false
                });
                var oParagraph = oDocument.GetElement(0);
                oParagraph.AddElement(oTextForm);
                oTextForm.SetText("John Smith");
            }, true);
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants