|
|
@@ -60,7 +60,9 @@
|
|
|
<div class="container-fluid"> <!--begin::Row-->
|
|
|
<div class="row">
|
|
|
<div class="col-sm-6">
|
|
|
- <h3 class="mb-0">🏷️ Product Attributes <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
|
|
|
+ <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();
|
|
|
});
|