论坛首页 Web前端技术论坛

现在JQUERY遇到个问题,就能不能横排显示数据

浏览 1313 次
该帖已经被评为隐藏帖
作者 正文
   发表时间:2009-08-25  


现在的值是竖排,我想横排,每行显示2条信息,请问怎么弄

<%@page contentType="text/html; charset=utf-8"%>  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml">  
    <head>  
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  
        <title>Flexigrid测试</title>  
        <link rel="stylesheet" href="style.css" />  
        <link rel="stylesheet" type="text/css"  
            href="css/flexigrid/flexigrid.css">  
        <script type="text/javascript" src="lib/jquery/jquery.js"></script>  
        <script type="text/javascript" src="flexigrid.js"></script>  
    </head>  
    <body>  
        <table id="flex1" style="display: none"></table>  
        <script type="text/javascript">  
            $("#flex1").flexigrid   
            (   
            {   
            url: 'http://localhost:8080/Flexigrid/DBServlet',   
            dataType: 'json',   
            colModel : [   
  
                {display: '职位名称', name : 'job_name', width : 180, sortable : true, align: 'left'}   
                ],   
            buttons : [   
                {name: 'Add', bclass: 'add', onpress : test},   
                {name: 'Delete', bclass: 'delete', onpress : test},   
                {separator: true}   
                ],   
            searchitems : [   
                {display: '职位名称', name : 'jobtitle'},   
                {display: '地点', name : 'workplace', isdefault: true}   
                ],   
            usepager: true,   
            title: '最新职位',   
            useRp: true,   
            rp: 15,   
            showTableToggleBtn: true,   
            width: 700,   
            height: 200 ,   
            procmsg: '正在获取数据,请稍候 ...'    
            }   
            );   
               
            function test(com,grid)   
            {   
                if (com=='Delete')   
                    {   
                        confirm('Delete ' + $('.trSelected',grid).length + ' items?')   
                    }   
                else if (com=='Add')   
                    {   
                        alert('Add New Item');   
                    }              
            }   
  
        </script>  
  
    </body>  




java代码

    public String getJsonString(List list, Map pageInfo) {
    	List mapList = new ArrayList();   
    	for(int i = 0; i < list.size(); i++) {
    		Map cellMap = new HashMap();
    		cellMap.put("id", ((Map)list.get(i)).get("id"));
    		cellMap.put("cell", new Object[] {((Map)list.get(i)).get("job_name")});   
    		mapList.add(cellMap);
    	}
    	pageInfo.put("rows", mapList);
    	JSONObject object = new JSONObject(pageInfo);
    	return object.toString();
    }
  • 大小: 2.5 KB
   发表时间:2009-08-25  
请大家看一下怎么解决,给个办法
0 请登录后投票
论坛首页 Web前端技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics