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
Please note that this topic is already discussed in the following forum post:
Regards,
Vladimir Iliev
Telerik
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
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();
});
}
Slightly cleaner version
function
onGridEdit(arg) {
arg.container.find(
"input.k-input"
).focus(
function
() {
$(
this
).select();
});
}