surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.2k stars 812 forks source link

Add buttons below an image #4325

Open ivorycoast opened 2 years ago

ivorycoast commented 2 years ago

Are you requesting a feature, reporting a bug or asking a question?

Question (or feature?)

What is the expected behavior?

I would like to add buttons below the images when I use image Picker. Is it possible ? Something like that ? audio image

Having a button to play an audio.

Specify your

andrewtelnov commented 2 years ago

@ivorycoast You can use custom rendering functionality to achieve this. Here is the example. If you use react then we would have a better solution.

Thank you, Andrew

ivorycoast commented 2 years ago

@andrewtelnov thanks! I made it work with the question and the page, but I would like to do that on the "choices" items such as (please check the first item inside the choices list):

{
 "logoPosition": "right",
 "pages": [
  {
   "name": "page1",
   "elements": [
    {
     "type": "imagepicker",
     "name": "question1",
     "choices": [
      {
       "value": "lion",
       "imageLink": "https://surveyjs.io/Content/Images/examples/image-picker/lion.jpg",
       "popupdescription": "Select the operating system you are currently using.",
      },
      {
       "value": "giraffe",
       "imageLink": "https://surveyjs.io/Content/Images/examples/image-picker/giraffe.jpg"
      },
      {
       "value": "panda",
       "imageLink": "https://surveyjs.io/Content/Images/examples/image-picker/panda.jpg"
      },
      {
       "value": "camel",
       "imageLink": "https://surveyjs.io/Content/Images/examples/image-picker/camel.jpg"
      }
     ]
    }
   ]
  }
 ]
}

I did not find if it is possible.... Thanks!

ivorycoast commented 2 years ago

@andrewtelnov Is it possible to have an answer?

andrewtelnov commented 2 years ago

@ivorycoast What JavaScript framework do you use?

Thank you, Andrew

ivorycoast commented 2 years ago

@andrewtelnov Vue.JS

Thanks,

andrewtelnov commented 2 years ago

@ivorycoast Unfortunately our current vue implementation doesn't support getItemValueWrapperComponentName function as react and knockout do. This function allows to register custom rendering of choices for radiogroup and checkbox questions.

We will implement Angular rendering and then we will work on Vue3 that will support this function. We need it to build Creator V2 for Angular and Vue.

Thank you, Andrew

ivorycoast commented 2 years ago

@andrewtelnov I understand. Thank you for your prompt answer!

Cheers,