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

Custom item in column menu to be bound to field property

3 Answers 154 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marc
Top achievements
Rank 1
Marc asked on 17 Jun 2014, 04:06 PM
Hello,

I have a grid with 3 columns. In the grid options, I indicated that columnMenu is true. I also specified a columnMenuInit, in order to customize the column menu. What I want to do is to add an input bound to the header of the column, allowing me to change it there.

I tried something like this:

function columnMenuInit(e) {
            var menu = e.container.find(".k-menu").data("kendoMenu");
            var field = e.field;
            menu.append({ text: "Input name: <input data-bind='value: "+ field +"'>", encoded: false });
}

but it does not seem to bind to anything (the input is empty when I show the column menu).

Would you have any advice?

Thanks in advance,
Marc.

3 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 19 Jun 2014, 11:49 AM
Hello Marc,

You will successfully add the data-bind attribute however there is no logic that will perform the kendo.bind call.

http://trykendoui.telerik.com/@pesho/odOp

What exactly do you want to achieve, why you want to bind the value to be equal to the name of the column.

Regards,
Petur Subev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Marc
Top achievements
Rank 1
answered on 19 Jun 2014, 01:13 PM
Thanks for your reply.

What I am trying to achieve is to provide an inline UI that would show two input fields:
- one to allow the user to change the title of the column
- one to change the value of some additional property I would attach to the column

Would you have any recommendation on how to do this?

Thanks,
Marc.
0
Petur Subev
Telerik team
answered on 20 Jun 2014, 07:57 AM
Hello Marc,

I am afraid there is no feasible way to bind the input to such column meta information like title or type and change this dynamically. 

Kind Regards,
Petur Subev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Marc
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Marc
Top achievements
Rank 1
Share this question
or