{% load i18n %}


<style> 
    .word-wrap{
        width: 100%;white-space: normal;word-wrap: break-word;word-break: break-all;
    }
    #tb tbody td:nth-child(9){
        padding-top:2px;
        padding-bottom:2px;
    }

    #tb tbody td:nth-child(10){
        padding-top:2px;
        padding-bottom:2px;
    }


</style>



<script type="text/javascript">
    $(document).ready(function(){    
        var page_length=10; 

        var table=$('#tb').DataTable({
            dom: 'Bfrtip',
            autoWidth: true,
            pageLength: page_length,
            buttons: [{extend:'excelHtml5',text: '导出到Excel'}],   
            language:lng,           
            data:{{data|safe}},   
        });       

        table.columns().every( function () {                        
            var that = this;             
            $('input', this.footer() ).on( 'keyup change clear', function () {
                if ( that.search() !== this.value ) {
                    that.search( this.value ).draw();
                }
            });
        });      

        $('#tb').on("click","td a",function(event){
            var s=$(this).text();
            $(event.target.parentNode).addClass('row_selected');
            event.preventDefault();
            $.OpenDlg($(this).attr('href'),'订单 '+s+' 明细列表:',1000,700);              
        });      

       
    });
</script>



<ol class="breadcrumb">
        <li>经销商管理</li>
        <li>销售订单</li>     
</ol>


<div class="col-md-12 col-sm-12 col-xs-12">
    <div class="x_panel">
        <div  class="table-responsive">
            <table id='tb'  class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%">
            <thead>
                {% for c in clmns %}
                    <th>{{c}}</th>
                {% endfor %}
            </thead>
            <tbody></tbody>
            <tfoot>
                {% for c in clmns %}                   
                    <th><input type="text" placeholder="{{c}}"></th>                    
                {% endfor %}            
            </tfoot>
            </table>
        </div>
    </div>
</div>
