This is a migrated thread and some comments may be shown as answers.

make a field with command buttons non resizable

4 Answers 46 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vadim
Top achievements
Rank 1
Vadim asked on 09 Nov 2017, 02:39 PM

Hi.

There is a good example how to make a column non-resizable.

My grid has a command button plus a template button on the left side of the grid and I don't know how to refer to these buttons to make them non-resizable. 

 toolbar: [{ name: "create", text: "Add New Asset" }, { template: kendo.template($("#DueDateTemplate").html()) }, { template: kendo.template($("#rightToolbarTemplate").html()) }],
                columns: [
                    {
                        command: [{ name: "edit", text: { edit: " ", update: " ", cancel: " " } },
                          { name: "confirmButton", text: " ", template: "<a class='k-button k-grid-confirmButton' onclick ='onItemConfirm(this)'><span class='k-icon k-i-checkbox'></span></a>" },
                        ], title: "Edit / Confirm", width: "120px", locked: true
                    },
                    { field: "Attested", template: $("#attestedTemplate").html(), title: "Attested", width: "100px", locked: true },

 

Thank you

4 Answers, 1 is accepted

Sort by
0
Vadim
Top achievements
Rank 1
answered on 09 Nov 2017, 02:46 PM
forgot to paste a link to example
https://dojo.telerik.com/agAPAv
0
Konstantin Dikov
Telerik team
answered on 10 Nov 2017, 09:46 AM
Hi Vadim,

You can disable the resizing by using the index of the column. Please refer to the following example with the modified condition:
Hope this helps.


Regards,
Konstantin Dikov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Vadim
Top achievements
Rank 1
answered on 10 Nov 2017, 02:28 PM
Hi ,
Thank you Konstantin for a quick reply, Works perfect.
few more questions I have, referring to the example you have posted:

1. Do I need always to include a default style? And what is a purpose of it?
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.3.1026/styles/kendo.default.min.css">
2. Is it possible on grid load to maximize the width all columns to their content, but the same time maintain a min width defined in columns [ ] templates?

Thank you
0
Accepted
Konstantin Dikov
Telerik team
answered on 14 Nov 2017, 12:02 PM
Hello Vadim,

For detailed information about the themes you could refer to the following help article:
As for your second question, you could use the autoFitColumn method once the Grid is loaded, but it will not take into account the minResizableWidth defined in the column (if you are referring to that property):
The autoFitColumn method will traverse all records and the values in each cell in order to calculate the max width.


Best Regards,
Konstantin Dikov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Vadim
Top achievements
Rank 1
Answers by
Vadim
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or