how to pass two dimensional array to another function javascript -
i want header function main headers , sub headers 2 dimensional array. , pass array function.because want check print value exact match main header under subheader.
i declare 2 dimensional array below function. this,
var code = [[]];
headers function main headers assign subcategory , sub headers code. call 2 dimensional array this,
if (tmp === free['b'][y].subcategory) { html += '<td hidden="true">' + free['b'][y].code + '</td>'; html += '<td>' + free['b'][y].code + '</td>'; ------------------------------------- code= [ free['b'][y].code]; -------------------------------------- // alert(code [code]); [cryspy,mmnuts cryspy,mmjhf cryspy,bbghr bar,ffata bar,yjkou.....etc] } else { html += '<td></td>'; html += '<td hidden="true">' + free['b'][y].code + '</td>'; html += '<td>' + free['b'][y].code + '</td>'; tmp = free['b'][y].subcategory;
then call array function values sub headers.
(var = 0; < code.length; i++) { // // alert(code.length); display: 324 (var k = 0; k < cat[i].length; k++) { //alert(cat[i].length);//display 2 (var y = 0; y < order['rd'][x].qty.length; y++) { // alert("code1 == " + code[i] + " , code2 == " + order['rd'][x].qty[y].code); display code1==crspy,mmkhh code2===jklll // console.log(code[i] === order['rd'][x].qty[y].code); // alert(order['rd'][x].qty.length); if (code[i] === order['rd'][x].qty[y].code) { //alert(order['rd'][x][y].code); order_detail += '<td style="border-bottom: 1px solid black; border-right:1px solid black; padding: 3px; text-align:right">' + order['rd'][x].qty[y].qty + '</td>'; break; } else { order_detail += '<td style="border-bottom: 1px solid black; border-right:1px solid black; padding: 3px; text-align:right">0</td>'; break; } } } }
but not print qty.is 2 dimentional array wrong ...or?
Comments
Post a Comment