二次开发技巧 `1. 如何获取选中行的数据` 标签字段配置 ``` <t:dgFunOpt funname="queryTypeValue(id)" title="字段类型" urlclass="ace_button" urlfont="fa-search"></t:dgFunOpt> ``` JS写法 ``` function queryTypeValue(typegroupid,index){ var row = $('#typeGridTree').datagrid('getData').rows[index]; console.log(row); var title = '字典类型: '+ row.typegroupname ; } ``` 代码解读: ``` JS方法queryTypeValue的参数index: 是jeecg的标准参数,会自动传递,不需要手工赋值,通过index参数即可获取当前选中行的数据。 var row = $('#typeGridTree').datagrid('getData').rows[index]; '#typeGridTree' 是当前数据数据列表的ID,对应的<t:datagrid的name属性。 ``` 