在使用EasyUI的可编辑Treegrid功能时,需要在代码中设置Treegrid的内容;
由于Treegrid没有完全继承DataGrid的方法,比如Treegrid不可以使用行索引,以及Treegrid没有updateRow函数,而此时我们需要设置它的值时应该怎么做呢?
现在我将我的解决方法给大家分享出来,如下:
1、请看下图需求:单击单元格设置第三列的值
2、代码如下:
<!--前端代码-->
<table class="easyui-treegrid" id="dg" data-options="border:false">
<thead>
<tr>
<th data-options="field:'name'" width="40%">
<font class="my-datagrid-header">事项</font>
</th>
<th data-options="field:'code',align:'center'" width="20%">
<font class="my-datagrid-header">代码</font>
</th>
<th data-options="field:'num