`
yuexiahandao
  • 浏览: 16335 次
社区版块
存档分类
最新评论

list.js

fd 
阅读更多
$(document).ready(function(){
var pageSize = "4";
var way = "DESC";
var column = "last_modify_time";
    var actionUrl;
    if ($("#to_do_list").length == 1) {
        actionUrl = "../ajax/getToDoList.action";
    } else {
        actionUrl = "../ajax/getList.action";
    }
    getPageBean(actionUrl, 1, pageSize, column, way);
    $("#to_do_list").click(function(){
        getPageBean("../ajax/getToDoList.action", 1, pageSize, column, way);
    });
    $("#done_list").click(function(){
        getPageBean("../ajax/getDoneList.action", 1, pageSize, column, way);
    });
    $("#personal_list").click(function(){
    getPageBean("../ajax/getList.action", 1, pageSize, column, way);
    });
    $("#createNew").click(function(){
        location.href = "add.action";
        return false;
    });
   
});


function getHtml(list, actionUrl) {
    var html = "";
    html += "<div class='header'><ul><li class='fixed'>Title</li><li>Requester</li><li>Request Date</li><li>Request Type</li><li class='status'>Status</li><li class='lastModifyTime'>Last Modify Time</li></ul></div><div class='content'>";
    for(var i in list) {
        html += "<div><ul>";
        var title = list[i].title;
        if (title.length > 15) {
        title = title.substr(0,15);
        }
        html += "<li class='fixed'><a href='view.action?id="+ list[i].id +"'>" + title + "</a></li>";
        html += "<li>" + list[i].user.name + "</li>";
        var createTime = list[i].createTime;
        html += "<li>" + createTime.substr(0,16) + "</li>";
        html += "<li>" + list[i].type.name + "</li>";
        html += "<li class='status'>" + list[i].status + "</li>";
        var lastModifyTime = list[i].lastModifyTime;
        html += "<li class='lastModifyTime'>" + lastModifyTime.substr(0, 16) + "</li>";
        html += "</ul></div>";
    }
    html += "</div></div>";
   
    return html;
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics