when I click the View button to select the id of a certain piece of data in the table, I request multiple pieces of data according to id, and use each loop to render. After clicking, the next click will accumulate the last information
this is the code I wrote:
/ / data request for viewing the product details page of the data
function productDatas (orderNum,type) {
$.ajax({
type: "post",
data: {orderNo: orderNum},
url: "/manages/order/query_orderno",
success: function (data) {
var item="";
console.log(data);
var goodsDatas=data.data.detailList;//goodstype
console.log(data.data.detailList);
$.each(goodsDatas,function(i,result){ ///<button type="button" id="lookOrderDatas" class="btn btn-primary"></button>
item += "<tr height="50"><td>"+result.goodstitle+"</td><td>"+result.goodsid+"</td><td>"+result.quantity+"</td><td>"+result.totalprice+"</td><td style="width: 80px" ><button type="button" id="lookOrderDatas" class="btn btn-primary" style="display: none"></button></td></tr>";
if(result.goodstitle==1){
$("-sharplookOrderDatas").css("display","block");
}
});
$("-sharpproductDatas").append(item);
}
})
}
this is my picture
the environmental background of the problems and what methods you have tried
related codes
/ / Please paste the code text below (do not replace the code with pictures)