@model string
<div class="current-location">
    <ul>
        <li class="left"><i class="glyphicon glyphicon-home"></i><a href="javascript:void(0)" onclick="location.href=location.href">收件箱</a></li>
        <li class="right"><a href="javascript:void(0)" onclick="LoadData()" title="刷新"><span class="glyphicon glyphicon-refresh"></span></a></li>
    </ul>
</div>
@Html.Action("Tabhead", "MsgInbox")
<div class="main no-top-border">
    <div class="control-group clearfix">
        <div class="btn-group left">
            <button type="button" class="btn btn-default btn-sm ui-selectInvert">反选</button>
            <button type="button" class="btn btn-default dropdown-toggle btn-sm" data-toggle="dropdown" aria-expanded="false">
                菜单<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>
            </ul>
        </div>
        <div class="right form-inline form-group-sm controls">
            <input type="text" id="startthedate" name="startthedate" placeholder="开始日期" style="width:105px" onclick="laydate({istime:true,format:'YYYY-MM-DD'})" class="laydate-icon form-control ui-queryString">
            <input type="text" id="endthedate" name="endthedate" placeholder="结束日期" style="width:105px" onclick="laydate({istime:true,format:'YYYY-MM-DD'})" class="laydate-icon form-control ui-queryString">
            <select id="field" name="field" class="form-control ui-queryString ui-setName option_jj">
                <option value="uid">按发件人</option>
                <option value="title">按标题</option>
            </select>
            <input type="text" id="keyword" name="keyword" placeholder="请输入关键词" style="width:105px;" class="form-control ui-queryString ui-keyword" />
            <button type="button" class="btn btn-default btn-sm ui-queryString-search">确定</button>
            <span class="help-block"></span>
        </div>
    </div>

    <table border=0 cellpadding=0 cellspacing=0 width=100% 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">标题</td>
            <td align="center">发件人</td>
            <td align="center">发送时间</td>
            <td align="center">操作</td>
        </tr>
        <tr class="item" id="item_{id}">
            <td align="center"><input type="checkbox" id="id" name="id" value="{id}"></td>
            <td align=left class="title"></td>
            <td align="center">
                <span class="ui-convertTextById Member uid" data-custom-params="url:'@Url.Action("GetFieldByIds", "Member")',textField:'username'"></span>
            </td>
            <td align="center" class="thedate"></td>
            <td align="center">
                <div class="btn-group btn-group-sm">
                    <span style="display:none;" class="msg_id">{msg_id}</span>
                    <button type="button" class="btn btn-default btn-sm ui-dialog" data-custom-params="title:'收件内容查看',url:'@Url.Action("Edit")?id={id}&msg_id={msg_id}',width:'900px',height:'90%'">查看</button>
                    <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")"
        $("#tb_list").ListBind(url, {callBack: "LoadedInit" });

        $(function () {
            Loading();
            $(".item").each(function () {
                var msg_id = $(this).find(".msg_id").text();
                var json = eval("(" + CallAjax("get", false, "@Url.Action("GetMsg")", "id=" + msg_id) + ")");
                $(this).find(".title").text(json[0].title)
                $(this).find(".uid").text(json[0].uid)
                $(this).find(".thedate").text(json[0].thedate)
            })
            ConvertText($(".Member"));
            CloseLoading();
        })
    }
    LoadData();

</script>