新建拦截器实现行拦截器的接口
class="java">package com.baidu.interceptor; import org.ecside.core.TableModel; import org.ecside.core.bean.Row; import org.ecside.table.interceptor.RowInterceptor; import com.baidu.entity.Book; public class BookInterceptor implements RowInterceptor { @Override public void addRowAttributes(TableModel arg0, Row arg1) { // TODO Auto-generated method stub } @Override public void modifyRowAttributes(TableModel model, Row row) { Book book = (Book) model.getCurrentRowBean(); Boolean isTrue = book.getIsTrue(); if (isTrue) { row.setStyle(""); row.setOnclick(""); } else { row.setStyle("cursor: pointer;"); row.setOnclick("javascript:test();"); } } }
?
修改ecside配置文件
row.interceptor.myIntercept = com.baidu.interceptor.BookInterceptor
?
修改行的属性
?
<ec:row interceptor="myIntercept">
?
结果是:
book对象属性istrue为false的时候,行点击事件为test()的js方法,鼠标样式为手势。
为true的时候,没有事件,鼠标样式为指针。
?
?