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

How to define memo-style editor for grid cells

3 Answers 589 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Veteran
Ron asked on 12 Dec 2011, 01:02 AM
I have a grid that is bound to a data-source with a schema - if I defined the grid editable, and the data-source has a schena that defines what fields are editable, and how to edit them.

If I define the type of a field as string - I get an editor that is one line only. Is there a way to define an editor that allows multiple lines (either dynamically when recognizing an enter key, or with a pre-defined line count)?

My current schema looks like:

 schema: {
          model: {
             id: "ID",
             fields: {
                  ID :{editable: false, nullable: false},
                  Time: { editable: false, nullable: true },
                  Monday: { type: "string" },
                  Tuesday: { type: "string" },
                  Wednesday: { type: "string" },
                  Thursday: { type: "string" },
                  Friday: { type: "string" },
                  Saturday: { type: "string" },
                  Sunday: { type: "string" }
             }
          } // model

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 13 Dec 2011, 01:50 PM
Hi Ron,

I'm afraid  that in the current version of KendoUI changing the editors are not supported. However, have already addressed this limitation and with the next version of the grid widget, specifying custom editors will be possible. I have attached a small sample using an internal build of KendoUI which demonstrates basic usage of such custom editor.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
João
Top achievements
Rank 1
answered on 06 Jan 2012, 06:32 PM
I am hardly trying to apply a custom editor to a grid column, with no success at all.

I have found this custom-editor.zip attachment from Rosen, and it does not work with current Kendo UI version (v2011.3.1129).

I have also found a code snippet in another forum thread which apparently uses a custom editor.

It seems my code is alright. My conclusion is that the feature is currently not working. Is this correct? If not, I'd like to see a small working sample / demo, where a custom editor is applied to a grid column. Or some workaround for the issue...

Thank you!

EDIT: Sorry, the attachment works if we use the kendo.all.min.js included there, which is ahead of the current release. It seems we need to wait for next release to use the feature... Is there a patch available for use before next release?
0
João
Top achievements
Rank 1
answered on 06 Jan 2012, 07:08 PM
For those who "desperately" need a custom editor now and can't wait for next release, just like me... :-)

...here is my workaround... change line #12320 of kendo.all.js to this:

fields: { field: column.field, format: column.format, editor: column.editor },

...and voilĂ ! Now the "editor" setting for the column makes effect!
Tags
Grid
Asked by
Ron
Top achievements
Rank 1
Veteran
Answers by
Rosen
Telerik team
João
Top achievements
Rank 1
Share this question
or