Bläddra i källkod

changes for the no data

VISHAL BHANUSHALI 3 månader sedan
förälder
incheckning
37b120ffc9
1 ändrade filer med 14 tillägg och 10 borttagningar
  1. 14 10
      content_quality_tool_public/templates/product-attributes.html

+ 14 - 10
content_quality_tool_public/templates/product-attributes.html

@@ -60,7 +60,9 @@
                 <div class="container-fluid"> <!--begin::Row-->
                     <div class="row">
                         <div class="col-sm-6">
-                            <h3 class="mb-0">🏷️ Product Attributes &nbsp;<span><a href="./../media/examples/product_attribute_template.xlsx"    title="Example file" download><i class="bi bi-download"></i></a></span></h3> 
+                            <h3 class="mb-0">🏷️ Product Attributes 
+                                &nbsp;<span><a href="./../media/examples/product_attribute_template.xlsx"    title="Example file" download><i class="bi bi-download"></i></a></span>
+                            </h3> 
                             
                         </div>
                         <div class="col-sm-6">
@@ -400,15 +402,17 @@ $(document).ready(function () {
             .then(data => {
                 console.log("data",data);
                 API_DATA = data;
-                renderAttributeTable(API_DATA);
-                // 2. ONLY THEN, initialize DataTables
-                if (jQuery.fn.DataTable) { // Optional safety check
-                    jQuery('#product-attribute-list').DataTable({
-                        // Ensure the table structure is maintained if you re-render
-                        destroy: true 
-                    });
-                } else {
-                    console.error("DataTables plugin not loaded.");
+                if(data.length > 0){
+                    renderAttributeTable(API_DATA);
+                    // 2. ONLY THEN, initialize DataTables
+                    if (jQuery.fn.DataTable) { // Optional safety check
+                        jQuery('#product-attribute-list').DataTable({
+                            // Ensure the table structure is maintained if you re-render
+                            destroy: true 
+                        });
+                    } else {
+                        console.error("DataTables plugin not loaded.");
+                    }
                 }
                 jQuery('#full-page-loader').hide();
             });