I known textbox could be placed in HeaderTemplate.
Single TextBox as filter row in each column header
But Navigatable() method causes textbox not focused automatically on click.
How can I solve this kind of problem.
*input/type=checkbox works well but input/type=text not works :
.HeaderTemplate("<input type='text' />");
*Telerik DevCraft R2 2017 SP1.
5 Answers, 1 is accepted
A possible solution to achieve the desired result might be handling the click event of the input and programmatically focusing it.
For a runnable example, check the modified Dojo: http://dojo.telerik.com/IxINal
I hope this helps.
OK, I known the focus(), but another problem is - if the textbox.text is "123" and click between "2" and "3" but the focus caret always after the last char.
I need a simple solution(not handles the caret position by myself).
The underlying cause of this behavior is that the Grid has logic that handles Grid header click when keyboard navigation is enabled and does its own focusing logic. To prevent this logic, you can add a mousedown event handler to the input elements and prevent the event from bubbling to the header.
This will let you focus the input as normal. Here is a Dojo to test this approach:
OK, But how about Sortable, click the header will handle only the sortable but textbox can't get focus too.
When a column is sortable, it has additional elements rendered, so the input element is no longer a direct child of the th element and the selector needs to be modified to reflect this. Try with: