<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>
<style type="text/css">
    .item-readed-1{color:#999}
    .item-readed-1 a{color:#999}
</style>
<div class="main">
    <ul class="navTabs">
        <li data-tab-params="tabName:'全部',tabValue:'',tabValueObjName:'#readed'"></li>
        <li data-tab-params="tabName:'未读',tabValue:'0',tabValueObjName:'#readed'"></li>
        <li data-tab-params="tabName:'已读',tabValue:'1',tabValueObjName:'#readed'"></li>
    </ul>
    <table class="tb-head" cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td 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 class="divider"></li>
                        <li><a href="javascript:void(0)" class="ui-updateMultiple" data-custom-params="url:'@Url.Action("Readed")'">标记为已读</a></li>
                    </ul>
                </div>
            </td>
        </tr>
    </table>
    <table border=0 cellpadding=0 cellspacing=0 class="table table-condensed" 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>
            </tr>
        </thead>
        <tr class="item list-template-item item-readed-{readed}" id="item_{id}">
            <td align="center">
                <input type="checkbox" value="{id}" class="checked-item">
                <input type="hidden" name="id" value="{id}" />
            </td>
            <td align="left"><span class="fa readed-{readed}"></span><a href="javascript:void(0)" class="ui-dialog" data-custom-params="title:'查看信息',url:'@Url.Action("Detail")?id={id}&readed={readed}'">{msgTitle}</a></td>
            <td align="center">{thedate}</td>
        </tr>
    </table>
</div>

<script type="text/javascript">
    //绑定数据
    var readed = Request("readed");
    var defaultTableIndex = 0;
    if (readed =="0")
    {
        defaultTableIndex = 1;
    }
    $(".navTabs").children().InitTab({defaultIndex:defaultTableIndex},function () { LoadData() }); //初始化选项卡，并设置回调函数为LoadData()

    function LoadedInit() {
        $(".readed-1").addClass("fa-folder-open-o");
        $(".readed-0").addClass("fa-folder-o");
    }
    function LoadData() {
        var url = "@Url.Action("PageListData")";
        $("#tb_list").ListBind({ url: url, callBack: "LoadedInit" });
    }
    LoadData();
</script>
