{% load i18n %}


<ol class="breadcrumb">
    <li> {{subtt.0}} </li> 
    <li> {{subtt.1}} </li> 
</ol>

<script type="text/javascript">
    $(document).ready(function(){        
        $('#cat_id').val('{{cat_id}}');
        
        $('.btn-qry').click(function(){ 
            var url='{{request.path}}?cat_id='+$('#cat_id').val();            
            $.RefreshContent(url);            
        });            
        var table=$('#tb').DataTable({
            //"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
            //"bLengthChange":true,
            dom: 'Bfrtip',
            autoWidth: false,
            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();
                }
            });
        }); 
    });
</script>

<form role="form"  class="form-inline" style="margin-top:0px;">
    {% trans '物料类别：'%}
    <select class='form-control' id='cat_id' style='width:200px;'>
        {% for c in cats %}
            <option value='{{c.id}}'>{{c.name}}</option>
        {% endfor %}
    </select></span>
    <a type='button' class='btn btn-primary btn-qry' style='margin-top:4px;'>{% trans '查询' %}</a> 
</form>

<div id="inventory-list" class="table-responsive">
    <div class='x_panel'>    
    <table id="tb" class="table table-striped table-bordered dt-responsive" 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>
