createObjectDataadd: function(component, event) {
var index = event.getParam("indexVar");
console.log(index);
var RowItemList1 = component.get("v.QuotelinitemList");
RowItemList1.push({
'sobjectType': 'Quote_Line_Item__c',
'Name':'',
'Client_P_N__c': ''
});
RowItemList1.splice(index+1,0,RowItemList1);
// for (var i = index; i <RowItemList1.length; i++) {
// RowItemList1.splice(index+1,0,rowli);
// }
component.set("v.QuotelinitemList", RowItemList1);
//RowItemList1.splice(index-1,0,RowItemList1);
},
Quote_Line_Item__c is an object. suppose it has three records. Every record has index value. Every record has button new quote_line_item button which it is pushing a new quote line item record at end of the array.
My problem is it adding at the last index.I want to add it on next index where the record new quote line item button is pressed.
I tried many ways but it is not coming.