问个easy ui的treegrid的小白问题

ly8261861 2019-01-10 10:57:50
最近项目需要用到treegrid,没接触过,拿demo练练手,结果出了个很小白的问题,就是编辑函数能正常运行完毕,但是treegrid的被选中行不会进入编辑状态。
代码直接修改的官方demo,只是将其中的构造treegrid方法从:
<table id="tg" class="easyui-treegrid" title="Editable TreeGrid" style="width:700px;height:250px"
data-options="
iconCls: 'icon-ok',
rownumbers: true,
animate: true,
collapsible: true,
fitColumns: true,
url: 'treegrid_data2.json',
method: 'get',
idField: 'id',
treeField: 'name',
showFooter: true
">
<thead>
<tr>
<th data-options="field:'name',width:180,editor:'text'">Task Name</th>
<th data-options="field:'persons',width:60,align:'right',editor:'numberbox'">Persons</th>
<th data-options="field:'begin',width:80,editor:'datebox'">Begin Date</th>
<th data-options="field:'end',width:80,editor:'datebox'">End Date</th>
<th data-options="field:'progress',width:120,formatter:formatProgress,editor:'numberbox'">Progress</th>
</tr>
</thead>
</table>
换成了用JS的:
$('#tg').treegrid({
url:'testjson.json',
idField:'id',
treeField:'name',
columns:[[
{field:'name',title:'name',width:180},
{field:'persons',title:'Persons',width:100,align:'right'},
{field:'begin',title:'Begin Date',width:180},
{field:'end',title:'End Date',width:180}
]]
});
其他代码都没改,当然保留了
<table id="tg" class="easyui-treegrid" title="Editable TreeGrid" style="width:700px;height:250px">

</table>给js实例化操作。
...全文
97 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
ly8261861 2019-01-10
  • 打赏
  • 举报
回复
果然是小白问题,自己找到答案了。悲剧

87,922

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧