vendredi 19 septembre 2014

How to add commas between 2 span elements created dynamically


Vote count:

0




Im trying to add a delimited between my 2 <span> elements. here is my code:



mRender: function (data, type, obj) {
var returnVal = "";
_.each(obj.qaccess, function(item, index){

returnVal += "<span class='_product'>" + item["product"] + "</span>";

});
return returnVal;
}


The obj.qaccess returns this:



postalCode: "95035"
qaccess: [{product:aa, status:enabled, roleIdentifiers:[], permissionIdentifiers:[]},…]
0: {product:aa, status:enabled, roleIdentifiers:[], permissionIdentifiers:[]}
permissionIdentifiers: []
product: "aa"
roleIdentifiers: []
status: "enabled"
1: {product:bb, status:Active, roleIdentifiers:[], permissionIdentifiers:[]}
permissionIdentifiers: []
product: "bb"
roleIdentifiers: []
status: "Active"
sfAccountId: null


im trying yo get the item['product'] value in the span element. if there are more than two values for the 'product', im looking to separate them with a comma.


Any ideas how can i achieve this?



asked 30 secs ago







How to add commas between 2 span elements created dynamically

Aucun commentaire:

Enregistrer un commentaire