<div id="cv-article-table-header">
    <div class="panel-title">
        <a href="javascript:archiveWindow('<?= url('new',['category_id'=>$category_id]); ?>','650px','520px')" class="easyui-linkbutton">+ <?= lang('New'); ?></a>
    </div>
</div>
<table id="cv-article-table" style="height: 100%;"></table>
<script type="text/javascript">
    $(function () {
        var cvArticleTable = $('#cv-article-table');
        var cvArticlePageSize = parseInt((bodyHeight-137)/32);
        cvArticleTable.datagrid({
            url:'<?= url('index', ['category_id'=>$category_id]); ?>',
            columns:[[
                {field:'ck',checkbox:true,width:10},
                {field:'id',title:'ID',width:15,halign:'center'},
                {field:'title',title:'<?= lang('Title'); ?>',width:250,halign:'center'},
                {field:'status',title:'<?= lang('Status'); ?>',width:25,halign:'center'},
                {field:'author',title:'<?= lang('Author'); ?>',width:25,halign:'center'},
                {field:'actions',title:'<?= lang('Available operations'); ?>',width:70,halign:'center'},
                {field:'create_time',title:'<?= lang('Create time'); ?>',width:70,halign:'center'},
                {field:'update_time',title:'<?= lang('Update time'); ?>',width:70,halign:'center'}
            ]],
            pagination: true,
            scrollbarSize:0,
            pageList: [cvArticlePageSize],
            pageSize: cvArticlePageSize,
            border:false,
            fitColumns: true,
            striped: true,
            header: '#cv-article-table-header'
        });
        var cvArticlePager = cvArticleTable.datagrid('getPager');
        cvArticlePager.pagination({
            showPageList:false
        });
    });

    function reloadArchiveListData() {
        $('#cv-article-table').datagrid('reload');
    }
</script>
