@model string
<div class="main no-border no-padding">
        <table border=0 cellpadding=0 cellspacing=0 class="table table-bordered" id="tb_list">
            <thead>
                <thead><tr>
                    <td align="center">模板目录</td>
                    <td align="center" style="width:40px">选择</td>
                </tr>
            </thead>
            <tr class="item list-template-item" id="item_{id}">
                <td align=left><span class="folder"></span>{Name}</td>
                <td align="center">
                    <div class="btn-group btn-group-sm">
                        <a href="javascript:void(0)" class="btn btn-default btn-sm btn_select btn_{Type}_select" name="{name}">选择</a>
                    </div>
                </td>
            </tr>
        </table>
    <div class="tishi"><i class="fa fa-exclamation-circle"></i>模板放在/Templates目录下，每个文件夹表示一个模板!</div>
</div>
<script type="text/javascript">

    var objName = Request("objname");
    var $parentObj = parent.$(objName);
    if ($parentObj.length == 0) {
        alert("父级的objid对象未找到！")
    }

    //绑定数据
    function LoadData() {
        var params={url:"@Url.Action("TemplatesDirectoryList")",showFooter:false}
        $("#tb_list").ListBind(params);
    }
    LoadData();

    $(document).on("click", ".btn_select", function (event) {
        var $this = $(this);
        if ($this.attr("disabled")) { return;}
        var name = $this.attr("name");
        $parentObj.val(name);
        CloseDialog();
    });
</script>


