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

Autocomplete choicesByUrl url variables #147

Open
Evertude opened this issue Oct 21, 2019 · 5 comments
Open

Autocomplete choicesByUrl url variables #147

Evertude opened this issue Oct 21, 2019 · 5 comments

Comments

@Evertude
Copy link

Hi,
I'd like to be able to use variables in the choicesByUrl path of the autocomplete widget - like it is already possible with dropdowns as shown in https://surveyjs.io/Examples/Library/?id=questiontype-dropdownrestfull.

Because of issue #145, I could only test with with 1.0.99.

Is there any way of achieving it?

@Evertude Evertude changed the title Autocomplete choicesByUrl path variables Autocomplete choicesByUrl url variables Oct 21, 2019
@WJ89
Copy link

WJ89 commented Oct 23, 2019

I'm having the same issue, I got the latest version working by using @gologames fixes at the top of my js file:

Array.prototype.push.apply( Survey.matrixDropdownColumnTypes.text.properties, ["choices", "choicesOrder", "choicesByUrl", "otherText"]);

Survey.JsonObject.metaData.addProperty("text", { name: "choicesByUrl:restfull", className: "ChoicesRestfull" });

however using variables in the URL still isn't working

@tsv2013
Copy link
Member

tsv2013 commented Oct 23, 2019

This functionality hasn't been implemented for custom widgets. We'll take a look whether we can implement it quickly.

@gologames
Copy link
Contributor

Hello,

Unfortunately is too much complex task to add this functionality and we have more priority tasks now. We update this thread immediately if this functionality will be added in the future

Thanks, Alex
SurveyJS Team

@Evertude
Copy link
Author

Hey,
Since this feature is important for me, I might check it out myself - I would appreciate it if you could maybe give me some tips.

@gologames
Copy link
Contributor

Hello,

You may try to carry all properties/methods related to choices/choiesByUrl from QuestionSelectBase class of SurveyModel to new subclass like QuestionChoices. And inherit QuestionTextModel from this class too

Thanks, Alex
SurveyJS Team

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

No branches or pull requests

4 participants