hide columns on inserting in data grid devextreme

喜你入骨 提交于 2020-01-17 06:35:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!