surveyjs / custom-widgets

The collection of custom widgets for SurveyJS: Survey Library and Survey Creator :package:
https://surveyjs.io
MIT License
80 stars 78 forks source link

Autocomplete choicesByUrl url variables #147

Open Evertude opened 5 years ago

Evertude commented 5 years ago

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 https://github.com/surveyjs/widgets/issues/145, I could only test with with 1.0.99.

Is there any way of achieving it?

WJ89 commented 5 years ago

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 commented 5 years ago

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

gologames commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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