
<div class="main">
    <table border=0 cellpadding=0 cellspacing=0 class="tb-head form-inline form-group-sm">
        <tr>
            <td class="left">
                <div class="btn-group btn-group-sm">
                    <button type="button" class="btn btn-default btn-sm " onclick="SetSite()">却换到选中站点</button>
                </div>
            </td>
            <td align="right">
                <select class="form-control ui-queryString ui-setName" style="width:120px;">
                    <option value="name">站点名称</option>
                    <option value="domain">绑定域名</option>
                    <option value="directory">站点目录</option>
                </select>
                <input type="text" placeholder="搜索关键词" class="form-control ui-keyword ui-queryString">
                <button type="button" class="btn btn-default btn-sm ui-queryString-search">搜索</button>

            </td>
        </tr>
    </table>
    <table border=0 cellpadding=0 cellspacing=0 class="table table-bordered" id="tb_list">
        <thead>
            <tr>
                <td align="center" width="60px">选择</td>
                <td align="center">站点名称</td>
                <td align="center">目录</td>
                <td align="center">绑定域名</td>
            </tr>
        </thead>
        <tr class="item list-template-item" id="tr_{id}" username="{name}">
            <td align="center"><input type="radio" id="id" name="id" value="{id}" class="ck"></td>
            <td align="center">{name}</td>
            <td align="center">{directory}</td>
            <td align="center">{domain}</td>
        </tr>
    </table>
</div>
<script type="text/javascript">

    function LoadInit()
    {
        var $idObj = $("input[name='id']");
        var currentSiteId = "@ViewBag.SiteId";
        $idObj.SetChecked(currentSiteId);
    }
    function LoadData() {
        var ajaxUrl = "@Url.ActionUrl("PageListData")?_byuser=1&_isload=1"
        $("#tb_list").ListBind({ url: ajaxUrl, callBack: "LoadInit" });
    }
    LoadData();

    function SetSite()
    {
        var $idObj = $("input[name='id']");
        var id = $idObj.GetChecked();
        if(id=="")
        {
            Msg("请选择要管理的站点！");
            return;
        }
        Ajax({ type: "post", dataType: "text",async: false, url: "@Url.ActionUrl("SetCurrentSite")", data: {id:id } });
        top.location.href = top.location.href;
        CloseDialog();
    }
</script>
