Heera/public/assets/js/pages/ecommerce-product-list.init.js

1 line
15 KiB
JavaScript
Raw Normal View History

2024-05-16 03:46:08 +00:00
var productListAllData=[{id:1,product:{img:"assets/images/products/img-1.png",title:"Half Sleeve Round Neck T-Shirts",category:"Fashion"},stock:"12",price:"215.00",orders:"48",rating:"4.2",published:{publishDate:"12 Oct, 2021",publishTime:"10:05 AM"}},{id:2,product:{img:"assets/images/products/img-2.png",title:"Urban Ladder Pashe Chair",category:"Furniture"},stock:"06",price:"160.00",orders:"30",rating:"4.3",published:{publishDate:"06 Jan, 2021",publishTime:"01:31 PM"}},{id:3,product:{img:"assets/images/products/img-3.png",title:"350 ml Glass Grocery Container",category:"Grocery"},stock:"10",price:"125.00",orders:"48",rating:"4.5",published:{publishDate:"26 Mar, 2021",publishTime:"11:40 AM"}},{id:4,product:{img:"assets/images/products/img-4.png",title:"Fabric Dual Tone Living Room Chair",category:"Furniture"},stock:"15",price:"340.00",orders:"40",rating:"4.2",published:{publishDate:"19 Apr, 2021",publishTime:"02:51 PM"}},{id:5,product:{img:"assets/images/products/img-5.png",title:"Crux Motorsports Helmet",category:"Automotive Accessories"},stock:"08",price:"175.00",orders:"55",rating:"4.4",published:{publishDate:"30 Mar, 2021",publishTime:"09:42 AM"}},{id:6,product:{img:"assets/images/products/img-6.png",title:"Half Sleeve T-Shirts (Blue)",category:"Fashion"},stock:"15",price:"225.00",orders:"48",rating:"4.2",published:{publishDate:"12 Oct, 2021",publishTime:"04:55 PM"}},{id:7,product:{img:"assets/images/products/img-7.png",title:"Noise Evolve Smartwatch",category:"Watches"},stock:"12",price:"105.00",orders:"45",rating:"4.3",published:{publishDate:"15 May, 2021",publishTime:"03:40 PM"}},{id:8,product:{img:"assets/images/products/img-8.png",title:"Sweatshirt for Men (Pink)",category:"Fashion"},stock:"20",price:"120.00",orders:"48",rating:"4.2",published:{publishDate:"21 Jun, 2021",publishTime:"12:18 PM"}},{id:9,product:{img:"assets/images/products/img-9.png",title:"Reusable Ecological Coffee Cup",category:"Grocery"},stock:"14",price:"325.00",orders:"55",rating:"4.3",published:{publishDate:"15 Jan, 2021",publishTime:"10:29 PM"}},{id:10,product:{img:"assets/images/products/img-10.png",title:"Travel Carrying Pouch Bag",category:"Kids"},stock:"20",price:"180.00",orders:"60",rating:"4.3",published:{publishDate:"15 Jun, 2021",publishTime:"03:51 PM"}},{id:11,product:{img:"assets/images/products/img-1.png",title:"Half Sleeve Round Neck T-Shirts",category:"Fashion"},stock:"12",price:"215.00",orders:"48",rating:"4.2",published:{publishDate:"12 Oct, 2021",publishTime:"10:05 AM"}},{id:12,product:{img:"assets/images/products/img-2.png",title:"Urban Ladder Pashe Chair",category:"Furniture"},stock:"06",price:"160.00",orders:"30",rating:"4.3",published:{publishDate:"06 Jan, 2021",publishTime:"01:31 PM"}}],inputValueJson=sessionStorage.getItem("inputValue"),editinputValueJson=(inputValueJson&&(inputValueJson=JSON.parse(inputValueJson),Array.from(inputValueJson).forEach(e=>{productListAllData.unshift(e)})),sessionStorage.getItem("editInputValue")),productListAll=(editinputValueJson&&(editinputValueJson=JSON.parse(editinputValueJson),productListAllData=productListAllData.map(function(e){return e.id==editinputValueJson.id?editinputValueJson:e})),document.getElementById("addproduct-btn").addEventListener("click",function(){sessionStorage.setItem("editInputValue","")}),new gridjs.Grid({columns:[{name:"#",width:"40px",sort:{enabled:!1},data:function(e){return gridjs.html('<div class="form-check checkbox-product-list">\t\t\t\t\t<input class="form-check-input" type="checkbox" value="'+e.id+'" id="checkbox-'+e.id+'">\t\t\t\t\t<label class="form-check-label" for="checkbox-'+e.id+'"></label>\t\t\t\t </div>')}},{name:"Product",width:"360px",data:function(e){return gridjs.html('<div class="d-flex align-items-center"><div class="flex-shrink-0 me-3"><div class="avatar-sm bg-light rounded p-1"><img src="'+e.product.img+'" alt="" class="img-fluid d-block"></div></div><div class="flex-grow-1"><h5 class="fs-14 mb-1"><a href="apps-ecommerce-product-details.html" class="text-body">'+e.product.title+'</a></h5><p class="text-muted mb-0">Category : <span class