0

你能帮我根据java函数返回的值改变网格行样式(粗体/细体)吗?

我只使用这个回调函数,它只是检查一个表中是否有记录并返回真/假。

我尝试了以下但没有奏效。我总是有瘦的风格。

    this.getView().getRowClass =function(record, index, rowParams, store){
      Service.isInsideTable(record.data.x, function(ok){            
        if (ok){
          return 'grid-row-opened';
        }else {
          return 'grid-row-new';
        }
      });               
    }

public boolean isInsideTable(String documentId,int contId){       
          boolean ok = false;
          DBUtil dbUtil = null;
          try { 
              dbUtil = new DBUtil("mydb");
              ResultSet res=null;
              String sql ="SELECT * FROM CIRCULAR_PER_USER WHERE DOCUMENT_ID ='"+documentId+"' and CONTACT_ID="+contId;
              res=dbUtil.execQuery(sql);
              //ok = true;
              if (res.next()) ok=true;
          }
          catch (Exception e)
          { 
              e.printStackTrace(); 
          }
          finally {
              if (dbUtil !=null){
                  dbUtil.close();
              }
          } 
          return ok; 
      }
4

0 回答 0