在网上搜索了很多关于ui-grid的问题
很遗憾好少啊啊啊
不过有api还是比较欣慰的
官方api:
还有一位大佬的翻译的中文api:
行编辑的官方api传送门:
好了,回到主题。行编辑,在div中加入属性
<div style="width: 100%;height: 398px;text-align: center;" class="ui-grid" id="command-grid" ui-grid="gridoptions" ui-grid-resize-columns ui-grid-pagination ui-grid-pinning ui-grid-selection ui-grid-move-columns ui-grid-save-state ui-grid-auto-resize ui-grid-edit> </div>
标红变大的部分:ui-grid-edit
效果为如下动图
可以实现行编辑的效果,可是列表的全部数据都可以编辑!
这显然不是我们要的需求
我们只需要指定某些字段可以进行编辑
使用:enablecelledit
官方api传送门:
好了,使用谷歌翻译出意思是这样说的
ok,enablecelledit默认是true,需要手动指定为false,禁止编辑
在columndefs中,enablecelledit : false
{ field: 'projectshortname', displayname: '项目简称', width: 300, pinnedleft: true, enablecelledit: false, celltemplate: "<span>{{(row.entity.projectshortname != undefined) ? (row.entity.projectshortname) : '-'}}</span>" },
就ojbk啦
--------------------------------------------
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
css3 flex布局 justify-content:space-between 最后一行左对齐
网友评论