问题
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);
}
}...
]
回答1:
In your case you need to customize an editing form. Well, you can use the column.formItem option like below:
columns: [{
/*...*/
formItem: { visible: false }
}]
I've updated your sample as well.
来源:https://stackoverflow.com/questions/42778989/hide-columns-on-inserting-in-data-grid-devextreme