1

在此处输入图像描述

但是使用surveyjs我找不到任何解决方案来添加单选按钮。

一些工作代码来编辑链接2

[1]: https://i.stack.imgur.com/CWQVL.png
  [2]: https://jsfiddle.net/myselfdesai/xeyqca75/
4

1 回答 1

1

据我了解,您正在尝试在单选按钮组之间添加子标题。

为此,您必须手动添加自定义 java-script 代码操作 DOM 元素。下面给出了surveyjs提供的功能。

survey
    .onAfterRenderQuestion
    .add(function(){
     <add your custom javascript code>
     });

我添加了考虑基本 DOM 元素位置的代码。

survey
    .onAfterRenderQuestion
    .add(function(){
        $( 
        //first I have collected all the div element position of using question form id 
        let divs = document.querySelectorAll("#question_id form div");
        $('</br></br><span><h4> Medical/Dental</h4><span>').insertBefore(divs[0]);
        $('</br></br><span><h4> Nursing </h4></span>').insertBefore(divs[9]);

    });

这可以解决您的问题,记住添加适当的 div 对象索引以添加特定位置的跨度。

于 2018-11-22T00:50:18.493 回答