@model string
<div class="main">
    <table border=0 cellpadding=0 cellspacing=0 class="tb-head">
        <tr>
            <td>
                <div class="btn-group btn-group-sm">
                    <button type="button" class="btn btn-default ui-selectInvert">反选</button>
                    <div class="btn-group btn-group-sm">
                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                            菜单<span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu" role="menu">
                            <li><a href="javascript:void(0)" class="ui-deleteMultiple" data-custom-params="url:'@Url.Action("Delete")'">全部导入</a></li>
                            <li><a href="javascript:void(0)" class="ui-setMultiple" data-custom-params="url:'@Url.Action("Set")?table=@(ViewBag.Table)',setName:'replaceField',beforeExecuting:'PSet'">选中导入</a></li>
                            <li class="divider"></li>
                            <li><a href="javascript:void(0)"  class="ui-deleteMultiple" data-custom-params="url:'@Url.Action("DeleteWhole")',ids:'0',beforeExecute: 'BeforeExecute'">全部删除</a></li>
                            <li><a href="javascript:void(0)" class="ui-deleteMultiple" data-custom-params="url:'@Url.Action("Delete")'">选中删除</a></li>
                        </ul>
                    </div>
                </div>
            </td>
        </tr>
    </table>
    <table border=0 cellpadding=0 cellspacing=0 class="table table-bordered" id="tb_list">
        <thead><tr>
            <td align="center" width="30px"><input type="checkbox" title="选择" class="ui-selectInvert" data-custom-params="isReverse:false"></td>
            <td align="center" width="27%">标题</td>
            <td align="center" width="10%">表名</td>
            <td align="center" width="25%">来源地址</td>
            <td align="center" width="10%">站点</td>
            <td align="center" width="10%">栏目</td>
            <td align="center" width="15%">管理</td>
        </tr>
        <tr class="item form-group-sm" id="item_{id}">
            <td align="center"><input type="checkbox" id="id" name="id" value="{id}" /></td>
            <td align="left">{title}</td>
            <td align="center">
                <span class="ui-convertTextById InfoTable" data-custom-params="url:'@Url.Action("GetFieldByIds", "InfoTable")',textField:'remark'">{table_id}</span>
            </td>
            <td align="left"><a href="{source_url}" target="_blank">{source_url}</a></td>
            <td align="center">
                <span class="ui-convertTextById Site" data-custom-params="url:'@Url.Action("GetFieldByIds", "Site")'">{site_id}</span>
            </td>
            <td align="center">
                <span class="ui-convertTextById Column" data-custom-params="url:'@Url.Action("GetFieldByIds", "Column")'">{column_id}</span>
            </td>
            <td align="center">
                <div class="btn-group btn-group-sm">
                    <a href="javascript:void(0)" class="btn btn-default btn-sm ui-dialog" data-custom-params="title:'{title}-修改',url:'@Url.Action("Edit")?id={id}&collection_id={collection_id}',width:'80%',height:'90%',target:'_self'">修改</a>
                    <a href="javascript:void(0)" class="btn btn-default btn-sm ui-deleteSingle" data-custom-params="url:'@Url.Action("Delete")',id:'{id}'">删除</a>
                </div>
            </td>
        </tr>
    </table>
</div>

<script type="text/javascript">
    //绑定数据
    function LoadData()
    {
        var url = "@Url.Action("PageListData")?collection_id=@Request.QueryString["collection_id"]";
        $("#tb_list").ListBind(url, {callBack: "LoadedInit" });
        ConvertText($(".InfoTable"));
        ConvertText($(".Site"));
        ConvertText($(".Column"));
    }
    LoadData();
    function BeforeExecute()
    {
        var data = CallAjax("post", false, "@Url.Action("DeleteWhole")", "collection_id=@Request.QueryString["collection_id"]");
        if (data.State == "success" || data == "true") {
            Msg("删除成功")
            location.href = location.href;
        } else
        {
            Msg(data.Msg)
        }
        return false;
    }

</script>
