2

First, I know how to exclude a field by marking it 'editable: false' in the kendo data source.

I added a column with a button to the Kendo UI grid to open a window for a file upload. This column is not in the datasource! However, the column is now also displayed in the popup editor as a tetxtbox with 'File Upload' as a label (that is the column header name also as you can see in the screenshot).

How can I exclude/hide this column in the popup editor?
I am using Kendo UI version: "2014.2.716"

Thanks for your help!

Here is how I added the column to the grid, see the last line:

columns: [
            { field: "Id", hidden: true },
            { field: "Name", title: ........ },
            { field: "EnteredBy", title: "Entered by", hidden: true },
            { field: "UpdatedOn", type: "date",.....},
            { field: "UpdatedBy", title: "......},
            { command: ["edit", "destroy"], title: "Action", width: "80px" },
            { field: "Upload", title: "File Upload", width: "80px", template: '<button class="k-button" onClick="uploadFiles(#=Id#)">Upload<br/>Files</button>' }
        ],

and here is a screenshot that shows the column 'File Upload' with the button 'Upload File' in each cell in the grid-column.

enter image description here

This is the screenshot from the popup editor with the field that I would like to hide.

enter image description here

1 Answer 1

2

I think you should make that extra column a custom command instead of specifying a "field" for it.

Something like:

columns: [
    ...
    {
        command: { text: "Upload", click: uploadFiles},
        title: "File Upload",
        width: "80px"
    }
]

The uploadFiles function would then get passed a click event, from which it can get to the element that was clicked. You can add a data-id attribute to the row to get its Id from in the uploadFiles function, as they do in the demo linked above.

1
  • Thank you very much! I actually saw the custom command demo, but what I missed is that I need a second command line. this is what I have now: { field: "UpdatedBy", title: "Updated by", hidden: true }, { command: ["edit", "destroy"], title: "Action", width: "80px" }, { command: { text: "Upload Files", click: uploadFiles }, title: "File Upload", width: "75px" } ],
    – gm.
    Sep 28, 2014 at 20:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.