javascript - jQuery each doesn't add values for tr tag -
i tried iterate json object in html table. iterate on table values not apply trtag. here code
var inboxmsg = ajaxrequestwithnoarguments('common/getinboxmessagessubjects'); if(inboxmsg.responsetext === ''){ //do nothing }else{ $.each(inboxmsg.responsejson,function(i,value){ $('.table-inbox > tbody').append('<tr data-value="'+value.mailid+'"><td><input type="checkbox" id="'+value.mailid+'" /></td><td><b class="fa fa-paperclip"></b> <b class="fa fa-reply"></b> <b class="fa fa-check"></b></td><td>'+value.mail_type+'</td><td>'+value.subject+'</td><td>'+value.received_time+'</td></tr>'); if(value.isread === "0"){ $('#'+value.mailid).addclass('unread-message'); } }); } my custom data-value attribute not form json object. other values getting fine. issue in code?
Comments
Post a Comment