javascript - Display data in dynamic matrix format using jquery -


i below json webapi , need display data in matrix format on ui. how this?

the json data looks this:

[  {"shippingline_cd":"aac","sizetype_cd":"20bu","eristatus_cd":"active","shift_nbr":"1"},  {"shippingline_cd":"acl","sizetype_cd":"20bu","eristatus_cd" :"active","shift_nbr":"2"},  {"shippingline_cd":"ama","sizetype_cd":"20dr","eristatus_cd" :"active","shift_nbr":"1"},  {"shippingline_cd":"abc","sizetype_cd":"20dr","eristatus_cd" :"pending","shift_nbr":"2"},  {"shippingline_cd":"cde","sizetype_cd":"20dr","eristatus_cd" :"pending","shift_nbr":"3"},  {"shippingline_cd":"aac","sizetype_cd":"20dr","eristatus_cd" :"active","shift_nbr":"1"},  {"shippingline_cd":"cde","sizetype_cd":"20bu","eristatus_cd" :"pending","shift_nbr":"1"} ] 

this desired ui format:

desired ui format

because question shows no code, answer in pseudo code, write real code.

you (after first created html table):

data.foreach(item => {      var x = item.sizetype_cd == ("20bu" ? 2 : 0) + item.shift_nbr;      var y = 0; //some logic here y coordinate      table.children[y].chilren[x].text = item.eristatus_cd; //set status text }) 

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -