在插入数据网格devextreme时隐藏列 [英] hide columns on inserting in data grid devextreme
本文介绍了在插入数据网格devextreme时隐藏列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有什么办法可以隐藏插入数据网格的列吗?
我有一个网格,一个单元格有多个命令按钮。但是当我想要为这些按钮插入或更新时,它会渲染一个空的文本框。如何删除插入和更新文本框?
Is there any way to hide a column on inserting data grid? I have a grid that one cells have multi command buttons. But when I want to insert or update for those buttons it renders an empty textbox. How can I remove the textbox in inserting and updating?
我试过这个,但我不知道如何隐藏它:
I have tried this but I don't know how can I hide it:
columns:[...
{
allowHiding:true,
cellTemplate: function (container, options) {
$('<button type="button" class="btn btn-default"/>').addClass('dx-button btnLinkGrid')
.text('Commission')
.on('dxclick', function (info) {
var url = '/finantialinfo/commision';
window.location.href = url;
})
.appendTo(container);
$('<button type="button" class="btn btn-default"/>').addClass('dx-button btnLinkGrid')
.text('Restitution')
.on('dxclick', function (info) {
var url = '/finantialinfo/restitution';
window.location.href = url;
})
.appendTo(container);
}
}...
]
推荐答案
在你的情况下,你需要自定义一个编辑表单。那么,您可以使用 column.formItem < a>选项如下:
In your case you need to customize an editing form. Well, you can use the column.formItem option like below:
columns: [{
/*...*/
formItem: { visible: false }
}]
我更新了示例。
这篇关于在插入数据网格devextreme时隐藏列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文