Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by tangyunfeng on Mar 12, 2009 21:43
open dhtmlx forum
Re : Can't get userdata in row ?

//v.1.6 build 80512


function addCHLDhtmlxGrid(){

//alert(<%=userNo%>);
_userlistgrid = new dhtmlXGridObject('user_list');
    
     _userlistgrid.setImagePath("<%=path%>/script/dhtmlxSuite/dhtmlxGrid/codebase/imgs/");
     _userlistgrid.setHeader("户号,姓名,电话,住址,单位");
     _userlistgrid.setColumnIds("houseid,name,phone,address,company");
     _userlistgrid.setInitWidths("45,45,70,120,120");
     _userlistgrid.setColAlign("center,center,center,center,center");
     _userlistgrid.setColTypes("ro,ro,ro,ro,ro");
     _userlistgrid.setColSorting("str,str,str,str,str");
     _userlistgrid.attachEvent("onRowDblClicked",doOnUIRowDblClicked); //表格行双击事件
     _userlistgrid.setSkin("light");
     _userlistgrid.init();

_userlistgrid.load("searchDweller.action?userNo="+"<%=userNo%>");
}


StringBuffer xml = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
        xml.append("<rows>");        
        
        for(DwellerInfo dwellerInfo : dwellerInfos){
            
            xml.append("<row id=\"");
            xml.append(dwellerInfo.getHouseInfo().getUserNo());
            xml.append("\">");
                                    
            xml.append("<cell>");
            xml.append(dwellerInfo.getHouseInfo().getUserNo());
            xml.append("</cell><cell>");             
            xml.append(NullUtil.trimNull(dwellerInfo.getDwellerAccount().getDwellerName()));
            xml.append("</cell><cell>");
            xml.append(NullUtil.trimNull(dwellerInfo.getDwellerAccount().getDwellerMobile()));
            xml.append("</cell><cell>");
            xml.append(NullUtil.trimNull(dwellerInfo.getAreaMessage().getAreaAddress()+dwellerInfo.getAreaMessage().getAreaName()));
            xml.append("</cell><cell>");
            xml.append(NullUtil.trimNull(dwellerInfo.getDwellerAccount().getCorpName()));            
            xml.append("</cell>");
            
            xml.append("<userdata name=\""+dwellerInfo.getHouseInfo().getUserNo()+"\">");            
            xml.append(this.getUserData(dwellerInfo));        
            xml.append("</userdata>");
            
            xml.append("</row>");            
        
        }
        xml.append("</rows>");


Answer posted on Mar 13, 2009 06:28
Update for dhtmlxgrid 1.6 80512 which resolves mentioned issue will be sent by email in nearest time.