因为easyUI的datagrid组件是横着一格一格加载数据的,一行加载好了之后才会去加载下一行。所谓的列格式化,就是在加载某一列的所有单元格时,对即将加载到这些单元格的数据进行二次包装。

比如,我们要把部门编号都变成一个超链接,假如链接到百度,怎么做?

方法就是在你需要格式化的那一列上添加一个formatter,就像这样:

<th field="deptid" width="80"  align="center" formatter="deptidFormatter">部门编号</th>

属性值就是一个格式化函数,例:

function deptidFormatter(val){
	return "<a href='http://www.baidu.com' >" + val + "</a>";

}

相关文章:

  • 2021-08-17
  • 2021-11-14
  • 2021-04-16
  • 2021-08-04
  • 2021-10-28
  • 2021-09-21
  • 2022-12-23
猜你喜欢
  • 2021-10-20
  • 2021-07-08
  • 2021-07-04
  • 2021-08-05
  • 2021-12-30
  • 2021-07-05
  • 2022-01-17
相关资源
相似解决方案