在这个小提琴中,每个复选框都有id,它从json.There获得的是一个下拉式,也对应于每一行。
现在假设我选择了第1行和最后一行,那么复选框值是1和3。
选中复选框后,将只启用下拉菜单。现在,从第一行中,我从下拉菜单中选择了文本,从最后一行中选择了选项,然后单击“保存”之后,它应该返回1:text,3,option,以便将其传递给服务器,并执行仅给我1,2的必要的processing.The方式。
console.log($(".cd:checked").map(function () {return this.value;}).get().join(","));发布于 2014-05-27 09:21:03
根据我对这个问题的理解,这里有一个解决办法。如果它能解决问题,请告诉我。
$('#addNew tr').each(function(index,element){
if($(this).find('.cd').prop('checked')){
key=$(this).find('.cd').val();
value=$(this).find('.QSelect').val();
newObject.push(key + ":" + value);
}
});与好,平均和差复选框选择。小提琴
$('#addNew tr').each(function(index,element){
if($(this).find('.cd').prop('checked')){
key=$(this).find('.cd').val();
value=$(this).find('.QSelect').val();
var options=[];
$(this).find('.checkbox-inline input').each(function(i,e){
if($(this).prop('checked')){
options.push($(this).parents('label').text());
}
});
newObject.push(key + ":" + value + ":" + options.join(','));
}
});https://stackoverflow.com/questions/23884518
复制相似问题