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

Need ability to use input controls when in view mode

1 Answer 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rik
Top achievements
Rank 1
Rik asked on 16 Jul 2012, 03:54 PM
If you use an input control in a column (via row template or column template), the click event that tells the grid to switch to the editor template/function does not fire when you click directly on the input.  I see the code in the kendo.grid.js that ignores when this is an input, but I question why.  If you click to the left or right in the cell of input, the editor does show as I would expect. 

Note that the default behavior of showing text until you click the text and then the editor shows will not pass with our users. It is not clear that you can click on this text and that it will become an input.  This is just not intuitive.  They have specifically asked for input boxes in the columns that are editable both at view and edit time. 

To fulfill this requirement, I have had to resort to a pretty "hacky" workaround.  However, this does work across all IE7-9, Chrome, and FF.  I am creating an almost transparent div that covers the entire cell at view time.  User thinks they are clicking the input at view time, but in reality they are clicking the overlay (which is not an input and therefore gets past the code in kendo.grid that ignores clicks for inputs).

Anyone have a cleaner suggestion?

Below is the fiddle showing my workaround.   The first grid is default and requires that you click outside the input to get the editor.  The second grid has my hack and you can click anywhere in the cell to get the editor. 
http://jsfiddle.net/r2musings/HH9Qp/4/

1 Answer, 1 is accepted

Sort by
0
Keith
Top achievements
Rank 1
answered on 16 Jul 2012, 05:24 PM
I do not have a cleaner suggestion Rik but thanks for posting what you came up with.

I posted a related thread last week on this: http://www.kendoui.com/forums/ui/grid/grid-changes-not-reflected-in-datasource-when-using-templates.aspx

I'm not sure why this functionality isn't there out of the box but hopefully it gets added at some point in the near future.
Tags
Grid
Asked by
Rik
Top achievements
Rank 1
Answers by
Keith
Top achievements
Rank 1
Share this question
or