When i select multiple rows of a table and push a data in an array . He is create every time new array with duplicate value .. Please ! give me best solution.
My OutPut he display two array at a time
(2) [{…}, {…}]
0: {SKU: "K0012", ProductName: "Blender, Dry mill. 2 in 1 Juicer 100% Pure Copper,…tional 2 in 1 Juicer, Grinder and Chopper Machine", OrderNo: "125013853543546"}
1: {SKU: "C0040-2", ProductName: "Pack Of 12 Brushes/ Quality Fabrics Makeup Brush Set / Pack of 12 Brushes", OrderNo: "125592566258677"}
{SKU: "K0012", ProductName: "Blender, Dry mill. 2 in 1 Juicer 100% Pure Copper,…tional 2 in 1 Juicer, Grinder and Chopper Machine", OrderNo: "125013853543546"}
(2) [{…}, {…}]
0: {SKU: "K0012", ProductName: "Blender, Dry mill. 2 in 1 Juicer 100% Pure Copper,…tional 2 in 1 Juicer, Grinder and Chopper Machine", OrderNo: "125013853543546"}
1: {SKU: "C0040-2", ProductName: "Pack Of 12 Brushes/ Quality Fabrics Makeup Brush Set / Pack of 12 Brushes", OrderNo: "125592566258677"}
{SKU: "K0012", ProductName: "Blender, Dry mill. 2 in 1 Juicer 100% Pure Copper,…tional 2 in 1 Juicer, Grinder and Chopper Machine", OrderNo: "125013853543546"}
And i want only one Array not multiple with unqiue values
What I have tried:
function ChangeFun() {
$("input[name='case[]']").change(function () {
var values = new Array();
$.each($("input[name='case[]']:checked"), function () {
var data = $(this).parents('tr:eq(0)');
values.push({
'SKU': $(data).find('td:eq(2)').text(),
'ProductName': $(data).find('td:eq(3)').text(),
'OrderNo': $(data).find('td:eq(4)').text()
});
});
}