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

kendo ui grid batch edit - auto select cell on click

4 Answers 331 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Autobytel
Top achievements
Rank 1
Autobytel asked on 10 Jun 2013, 04:24 PM
I am using the latest kendo Grid script client with batch edit. Here is my code:
$("#Contract").kendoGrid({ 
  columns: [
     {
field: "SomeField",
 }],
editable: true,
scrollable: true,
navigatable: true,
selectable: "cell"

How do I make the cell selected when users click on a cell?
I saw a demo at http://demos.telerik.com/aspnet-mvc/razor/grid/editingbatch and wanted to do the same but I could not figure which setting is needed. For editable setting, I tried 0,1,and 2 but it does not seem to work like telerik grid.

4 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 11 Jun 2013, 10:15 AM
Hi George,


I would suggest you to take a look at the following Kendo UI Grid demos about Batch editing and Selection.
Please let me know if they were helpful for you or I could assist you further. I wish you a great day!

 

Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Tom
Top achievements
Rank 1
answered on 10 May 2016, 05:29 PM

Hi Dimiter, I'm not getting it b/c I cannot see how the reference to Batch editing and multi-cell selection answer the question that Autobytel asked.

I have the same question.  In the absence of a drag-and-fill capability in batch editing, our users need a more efficient method to copy/paste.  If a user clicks in a cell AND the existing value is automatically selected/highlighted, then users can simply paste (ctrl-v) a new value and move on.  Currently, it doubles their effort to click the cell, select or clear the existing value, and then do their paste.

Any suggestions you have is greatly appreciated - Thanks!

0
Dimiter Madjarov
Telerik team
answered on 11 May 2016, 08:26 AM

Hello Tom,

In the current you could attach a handler to the Grid's edit event

.Events(e => e.Edit("onEdit"))
and use jQuery's select method to trigger the select event of the input.

The following forum post demonstrates two possible scenarios and implementations - when using an input field or a Kendo Widget as an editor.

 

Regards,
Dimiter Madjarov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Terry
Top achievements
Rank 1
answered on 26 Aug 2016, 04:59 PM

For anyone else who reads this.  I added the event exactly like Dimiter said - that works.  But I made the onEdit JavaScript function a little different than the example.  The example was looking for a specific field.  I made the JavaScript select any field.

Here's my JavaScript code.  If anyone see's a better way of doing this, then please let me know.

function onEdit(e) {
 
    var inputName = e.container.find('input').attr("name");
    var myInput = e.container.find('input[name="' + inputName + '"]');
    myInput.select();
}

Tags
Grid
Asked by
Autobytel
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Tom
Top achievements
Rank 1
Terry
Top achievements
Rank 1
Share this question
or