Explorar el Código

changes for the product attributes

VISHAL BHANUSHALI hace 3 meses
padre
commit
cbc569c74f
Se han modificado 1 ficheros con 11 adiciones y 12 borrados
  1. 11 12
      content_quality_tool_public/templates/product-attributes.html

+ 11 - 12
content_quality_tool_public/templates/product-attributes.html

@@ -402,17 +402,15 @@ $(document).ready(function () {
             .then(data => {
                 console.log("data",data);
                 API_DATA = data;
-                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.");
-                    }
+                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();
             });
@@ -429,7 +427,8 @@ function renderAttributeTable(apiData) {
     $dataBody.empty(); // Clear existing rows
 
     if (!apiData || apiData.length === 0) {
-        $dataBody.append('<tr><td colspan="4">No product attributes found.</td></tr>');
+        $dataBody.append('<tr><td colspan="3">No product attributes found.</td></tr>');
+        jQuery('#full-page-loader').hide();
         return;
     }