You need to sign in to do that
Don't have an account?
PC
add rows on click of button in
Hi, I have a cart form which is a pop up.I want to add extra editable rows in the form on click of a button.
var products = ProductManager.getAllProducts();
$.each(products, function(){
var total = this.quantity * this.price;
$cartTable.append(
'<tr title="' + this.summary + '" data-id="' + this.id + '" data-price="' + this.price + '">' +
'<td class="text-center" style="width: 30px;"><img width="30px" height="30px" src="' + this.image + '"/></td>' +
'<td name="name<? $i ?>">' + this.name + '</td>' +
'<td title="Unit Price" name="unitprice<? $i ?>">Rs ' + this.price + '</td>' +
'<td title="Quantity" name="quantity<? $i ?>"><input type="number" min="1" style="width: 70px;" class="' + classProductQuantity + '" value="' + this.quantity + '"/></td>' +
'<td title="Total" class="' + classProductTotal + '"> Rs ' + total + '</td>' +
'<td title="Remove from Cart" class="text-center" style="width: 30px;"><a href="javascript:void(0);" class="btn btn-xs btn-danger ' + classProductRemove + '">X</a></td>' +
'</tr>'
);
var products = ProductManager.getAllProducts();
$.each(products, function(){
var total = this.quantity * this.price;
$cartTable.append(
'<tr title="' + this.summary + '" data-id="' + this.id + '" data-price="' + this.price + '">' +
'<td class="text-center" style="width: 30px;"><img width="30px" height="30px" src="' + this.image + '"/></td>' +
'<td name="name<? $i ?>">' + this.name + '</td>' +
'<td title="Unit Price" name="unitprice<? $i ?>">Rs ' + this.price + '</td>' +
'<td title="Quantity" name="quantity<? $i ?>"><input type="number" min="1" style="width: 70px;" class="' + classProductQuantity + '" value="' + this.quantity + '"/></td>' +
'<td title="Total" class="' + classProductTotal + '"> Rs ' + total + '</td>' +
'<td title="Remove from Cart" class="text-center" style="width: 30px;"><a href="javascript:void(0);" class="btn btn-xs btn-danger ' + classProductRemove + '">X</a></td>' +
'</tr>'
);
VisualForce Page:
Apex Code:
Hope it will be helpful.
Please mark it as best answer if the information is informative.so that question is removed from an unanswered question and appear as a proper solution.
Thanks
Rahul Kumar