Wex5 uses the list to display the title checkedbox and changes it to radio radio

 WeX5 uses the list to display the title checkedbox and changes it to radio radio

1. Idea 1 : Using the radio component, the value cannot be passed

2. Idea 2 : Use the checkbox to select one, and the others are not allowed to be selected

( 1 ) Find the corresponding checkedbox

( 2 ) Increase the corresponding onchange event

( 3 ) Select one and clear the others; select one and assign one by one? ? ? ? ? (Brain turns to mush here)     


Detailed breakdown ( 3 ):

3.1 Get the checkedbox element , get the current dom node

var $checkOne = $(event.source.$domNode);

Resolution: http://docs.wex5.com/wex5-ui-question-list-2077/

3.2 Get options other than selected, set unselected

$checkOne.parent().parent()

.siblings('.option-li')

.find('input[name=userOpt]')

.each(function(idx) {

        $( this ).prop( "checked" , false );  // unchecked

 });

.parent().parent()

.siblings()   all siblings of the selected element

.siblings("p") The   selected element specifies all sibling elements named <p>

.find()   traversal method

.each()

 


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325862173&siteId=291194637