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

Stop non-editable columns from being selectable / select cell text when entering editable cell

6 Answers 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brad
Top achievements
Rank 1
Brad asked on 03 Jun 2015, 12:58 AM

Hi all

I have an in-cell editable grid which I have managed to make so only several columns are editable. However, those non-editable columns are still selectable and when using tab, the tabbing does not skip these cells. Is there any way to make it so the tab order only selects the editable cells?

Also, when I enter one of the editable cells, the cursor puts itself at the start of the value and leaves the cell contents unselected. Is there any way to automatically select the cell's contents on enter?

Regards

Brad

6 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 04 Jun 2015, 01:40 PM
Hi Brad,

Please note that this topic is already discussed in the following forum post:

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Brad
Top achievements
Rank 1
answered on 05 Jun 2015, 12:07 AM
Thanks Vladimir, appreciated. I will review that post and implement it's recommendations. Any clues about my second question regarding selecting cell contents on enter?
0
Vladimir Iliev
Telerik team
answered on 05 Jun 2015, 05:37 AM
Hi Brad,

Basically selecting the text can be achieved using the focus event of the editor - for more information you can check the following forum thread:

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Brad
Top achievements
Rank 1
answered on 05 Jun 2015, 06:19 AM
Great, thanks Vladimir!
0
Brad
Top achievements
Rank 1
answered on 10 Jun 2015, 05:15 AM

Hi Vladimir

I had a problem with some of the suggestions in that post as when the page is loaded it does not appear the editing cells exist, only when the row is clicked. In case someone else has the same issue, I managed to get around this by doing the following on the edit event of the grid.

For the grid events

.Events(events => events.Edit("onGridEdit").SaveChanges("onGridSaveChanges"))

Then in the Javascript

function onGridEdit(arg) {
        $("input.k-input").focus(function () {
            $(this).select();
        });
    }

0
Brad
Top achievements
Rank 1
answered on 10 Jun 2015, 05:19 AM

Slightly cleaner version

function onGridEdit(arg) {
        arg.container.find("input.k-input").focus(function () {
            $(this).select();
        });
    }

Tags
Grid
Asked by
Brad
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Brad
Top achievements
Rank 1
Share this question
or