I have input type="text"in table. https://jsfiddle.net/L0vx0hck/
$('#myGrid').selectable({
filter: ".dataItemColumn,.dataText",
cancel: null,
distance: 10
});
td {
padding: 5px;
border: 1px solid black
}
.ui-selected {
background-color: lightblue
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table id="myGrid">
<tr>
<td class="dataItemColumn">
<input class="dataText" type="text" value="focusable" onclick="this.focus()" />
</td>
<td class="dataItemColumn">
<input type="text" class="dataText" value="aa" />
</td>
</tr>
<tr>
<td class="dataItemColumn">
<input type="text" value="focusable" onclick="this.focus()" />
</td>
<td class="dataItemColumn">
<input type="text" value="aa" />
</td>
</tr>
</table>
<input type="text" value="test" />
Run codeHide result<table id="myGrid">
<tr>
<td class="dataItemColumn">
<input type="text" class="dataText" value="aa" />
</td>
</tr>
I choose him
$('#myGrid').selectable({
filter: ".dataItemColumn,.dataText",
cancel: null,
distance: 10
});
After that, it is impossible to click on inputto start editing. As a partial workaround, I set onclick="this.focus()"to input. You can also omit cancel: null. The first option allows you to start editing only when begging the text and prohibits the selection of part of the text. Another option provides full editing capabilities, but prevents the selection from starting by dragging the text box.
So what I need:
, .