custom-widgets icon indicating copy to clipboard operation
custom-widgets copied to clipboard

Autocomplete choicesByUrl url variables

Open Evertude opened this issue 6 years ago • 5 comments

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?

Evertude avatar Oct 21 '19 11:10 Evertude

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

WJ89 avatar Oct 23 '19 04:10 WJ89

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

tsv2013 avatar Oct 23 '19 07:10 tsv2013

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

gologames avatar Oct 25 '19 13:10 gologames

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.

Evertude avatar Oct 25 '19 13:10 Evertude

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

gologames avatar Oct 28 '19 10:10 gologames