Subversion Repositories SmartDukaan

Rev

Rev 28641 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<style>
.priceTable tr th{
   
    padding-bottom:6px;
}

.priceTable tr td{
   
    padding-bottom:6px;
}

.modal {
     left: 1037px;
    top: 39px; 

}
</style>
<section>
<table class="table table-striped priceTable"  >
                        <thead>
                                         <tr class="price-drop-header">
                                                <th>Brand</th>
                                                #foreach($ym in $ym )
                                                 <th> <input type="hidden" value="$ym.format($dateMonthYearFormatter)"/> $ym.format($dateYearMonthFormatter)</th>
                                                 #end
                                                 <th>Total</th>
                                                 
                                        </tr>
                        </thead>
                                                            
                        <tbody>
                        
                        
                                         #foreach($sortedBrandValue in $sortedBrandValue.entrySet())
                          <tr> 
                          
                               <td class="brand_name"><b>$sortedBrandValue.getKey()</b></td>
                          #set($total = 0.0) 
                        #foreach($sortedBrandValue in $sortedBrandValue.getValue() )
                            #set($total = $total + $sortedBrandValue )
                           #if($sortedBrandValue != 0.0)                                 
                   <td><button type="button" class="btn btn-primary my-price-drop" data-id="$fofoId" data-toggle="modal" data-target="#priceDropDetailsContainer">$sortedBrandValue</button></td>
                                   #else
                                <td><b>-</b></td>
                              #end
                       #end
                                        #if($total != 0.0)
                           <td><b>$total</b></td>
                           #else
                           <td><b>0</b></td>
                           #end
                          </tr>
                                  #end
                                 
                                 
                                  
                        </tbody>
<div class="price-drop-details-container">
        <div id="priceDropDetailsContainer" class="modal" role="dialog">
                  <div class="modal-dialog modal-md">
                        <!-- Modal content-->
                        <div class="modal-content"  style="width: 300px;"></div>

                </div>
        </div>
</div>

                </table>
                
</section>
                
        <script>
        $(document).ready(function() {
        
        $(document).on('click', ".my-price-drop", function() {
        var fofoId= $(this).data('id');
                var brand = $(this).closest("tr").children('td:first').text();
        
  var yearMonth = $(this).closest('table').find('.price-drop-header input[type=hidden]').eq( $(this).closest("td").index()-1).val();
    console.log("id"+yearMonth+brand+fofoId);
   doGetAjaxRequestHandler(context + "/getPriceDropDetails?fofoId=" + fofoId  + "&brand=" + brand + "&yearMonth=" + yearMonth, function (response) {
                        $('.price-drop-details-container .modal-content').html(response);
                    });    
   
   
    }); 
       });       
        </script>