@using PageAdmin.Utils;
@{
    CurrentUser user = ViewBag.CurrentUser;
    int defaultSiteId = (int)ViewBag.CurrentSiteId;
    if (StringHelper.IsStr(Request.QueryString["siteId"]))
    {
        defaultSiteId = int.Parse(Request.QueryString["siteId"]);
    }
}
<div class="main">
    <table border=0 cellpadding=0 cellspacing=0 class="tb-head form-inline form-group-sm">
        <tr>
            <td>
                <div class="btn-group btn-group-sm">
                    <input type="hidden" id="tableId" name="tableId" value="@Request.QueryString["tableId"]" class="ui-queryString" />
                    <input type="hidden" id="uid" name="uid" value="@Request.QueryString["uid"]" class="ui-queryString" />
                    <button type="button" class="btn btn-default btn-sm ui-selectInvert">反选</button>
                    <button type="button" class="btn btn-default btn-sm " onclick="SelectData()">确定</button>
                </div>
            </td>
            <td align="right">
                    <div class="controls form-inline">
                        <select name="siteId" id="siteId" style="width:auto;display:inline" class="form-control ui-queryString" data-source="@Html.GetSiteListJsonByUser(user)" data-custom-params="dataSourceFrom:'attr'">
                            <option value="0">选择站点</option>
                        </select>
                        <button type="button"  class="btn btn-default btn-sm ui-queryString-search">切换</button>
                    </div>
                </td>
        </tr>
    </table>
    <table border=0 cellpadding=0 cellspacing=0 class="table table-bordered" id="tb_list">
        <thead>
            <tr>
                <td align="center" style="width:40px"><input type="checkbox" title="选择" class="ui-selectInvert" data-custom-params="isReverse:false"></td>
                <td align="left"><span>栏目/</span><span class="ui-folder-switch">展开</span></td>
            </tr>
        </thead>
        <tr class="item list-template-item" id="item_{id}"  data-parentId="{parentId}" data-id="{id}" data-isFinal="{isFinal}" name="{name}">
            <td align="center" style="width:40px"><input type="checkbox"  value="{id}" class="ck checked-item checked-item-isfinal-{isFinal} column-{columnType}"></td>
            <td align="left">{space}<span class="node node_{isFinal}"></span>{name}</td>
        </tr>
    </table>
</div>

<script type="text/javascript">

    var $siteId = $("#siteId");
    function BindSite()
    {
        var currentSiteId="@defaultSiteId"
        $siteId.SelectBind();
        $siteId.SetValue(currentSiteId);
    }
    BindSite();

    var objName = Request("objname");

    function LoadedInit()
    {
        SetSelectedDisabled();
        $(".checked-item-isfinal-0").attr("disabled", "disabled");
        $(".column-0").attr("disabled", "disabled");
        $(".column-2").attr("disabled", "disabled");
    }

    function LoadData() {
        var ajaxUrl="@Url.ActionUrl("ListData")?_isload=1"
        $("#tb_list").TreeBind({url:ajaxUrl,callBack: "LoadedInit",showFooter:false});
    }
    LoadData();
</script>
<script src="/Js/selectData.js" type="text/javascript"></script>