
<script type="text/javascript">
    $(document).ready(function(){
        var table=$('#tb').DataTable({            
            dom: 'Bfrtip',
            autoWidth: false,
            buttons: [{extend:'excelHtml5',text:'导出到Excel'}],           
            language:lng,           
            data:{{data|safe}},
            destroy:true,
        });      
        
        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();
                }
            });
        });

       

    });

    $(".btn-obj-add").click(function () { 
        event.preventDefault();
        $.RefreshContent($(this).attr('href'));        
    })

    $("#tb tbody").on('click','a',function(){
        event.preventDefault();
        $.RefreshContent($(this).attr('href'));   
    })


</script>


<style>
    #tb a {
        cursor:pointer;

    }  
   
</style>


<div id='list-tt' style='margin-bottom:10px;' current='{{url}}'>政策方案</div>
{% if show_add %}
    <div class="title_right">
        <div class="pull-right">
            <span class='input-group'> 
                <button type="button" class='btn btn-obj-add l-a create-btn'  href='/banquet/policy/edit/'>
                    <span class='glyphicon glyphicon-plus' style='padding-right:5px;'></span>新建
                </button>
            </span>
        </div>
    </div>
{% endif %}




<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>

