<li>This widget can not be applied to the original plugin and requires jQuery 1.7+ and a browser that supports <ahref="http://caniuse.com/#feat=contenteditable"><code>contenteditable</code> attributes</a> (almost all modern browsers).</li>
<li><spanclass="label warning">Important</span>: In Internet Explorer, please wrap the cell content with a DIV or SPAN as <ahref="http://msdn.microsoft.com/en-us/library/ie/ms533690(v=vs.85).aspx">it is not possible to make table cells directly contenteditable</a>. Wrapping the content in the markup is much more efficient than using javascript to do it for you (especially in IE).<br><br></li>
<li>Updated <spanclass="version">v2.17.6</span>,
<ul>
<li>Fixed the <code>editable_enterToAccept</code> option to do what it was meant to do, accept when the user presses enter.</li>
<li>Added <code>editable_autoAccept</code> option, so that when it is <code>true</code> the original behavior of accepting content changes will be maintained.</li>
<li>Added <code>editable_validate</code> option, to allow validating the edited content.</li>
<li>Focus is now maintained within the contenteditable element after updating. This makes it easier to tab through the table while editing. This change also fixes <ahref="http://stackoverflow.com/q/24947995/145346">this Stackoverflow issue</a>.</li>
<li>The <code>editComplete</code> event now passes the table <code>config</code> variable to make it easier to access tablesorter variables.</li>
<li>Updated <spanclass="version updated">v2.13.2</span>, because of the limitation in IE, if a table cell contains any DIV or SPAN immediately inside the cell, it will be targeted instead of the table cell itself and made content editable. So, if you don't care about IE support, there is no need to include the extra markup.</li>
<li>In some browsers, additional CSS is needed to highlight a focused editable table cell. See the CSS block below.</li>
<li>Pressing escape while editing will cancel any changes.</li>
<li>In the demo below, click in any of the first three columns to edit the content, except for the cell containing <spanclass="no-edit">"Peter"</span>.</li>
<li>To prevent a table cell from becoming editable, add the class name <code>"no-edit"</code> to the cell. Set by the <code>editable_noEdit</code> option.</li>
<liclass="color3">Clicking outside of the current editable content.</li>
<liclass="color3">Moving the mouse outside of the current tbody (this is done because if the content editable is still active when the user clicks on the header to sort the column, all sorts of bad things happen).</li>
</ul>
</td>
<td>
<ul>
<liclass="color1">Pressing alt-enter</li>
<liclass="color3">Clicking outside of the current editable content.</li>
<liclass="color3">Moving the mouse outside of the current tbody.</li>
</ul>
</td>
</tr>
<tr>
<th>false</th>
<td>
<ul>
<liclass="color1">Pressing alt-enter</li>
<liclass="color2">Pressing enter</li>
</ul>
</td>
<td>
<ul>
<liclass="color1">Pressing alt-enter</li>
</ul>
</td>
</tr>
</tbody>
</table>
* <spanclass="label label-info">Note</span> The content is only accepted when the <code>editable_validation</code> function <em>does not</em> return <code>false</code>.
<h4>Editable widget widget default options (added inside of tablesorter <code>widgetOptions</code>)</h4>
<div>
<spanclass="label label-info">TIP!</span> Click on the link in the function column to reveal full details (or <ahref="#"class="toggleAll">toggle</a>|<ahref="#"class="showAll">show</a>|<ahref="#"class="hideAll">hide</a> all) or double click to update the browser location.
<td>Contains an array (or range string) of columns numbers you want to have editable content (zero-based index).
<divclass="collapsible">
<ul>
<li>In tablesorter core <spanclass="version">v2.14.2</span>, this widget was updated to allow passing a range string in this option, i.e. <code>"0-2"</code> instead of <code>[0,1,2]</code>.</li>
<li><code>contenteditable="true"</code> is added to cells within these columns.</li>
<td>Set to automatically select all content when the contenteditable cell is focused (<spanclass="version">v2.17.8</span>)
<divclass="collapsible">
<br>
Set this option to a boolean, or a function that returns a boolean:
<ul>
<li>When <code>true</code>, all of the text within the current contenteditable element will be selected.</li>
<li>When <code>false</code>, no selection is made.</li>
<li>When this option contains a function, return either <code>true</code> to select all of the text within the element, or <code>false</code> to not select any text.</li>
<li>A <code>$element</code> parameter has been included which contains the contenteditable element. To get the table cell, use <code>$element.closest('td');</code></li>
This function must return either a string containing the modified content or <code>false</code> to revert the content back to it's original value. Example:
<td>Trim the content within the editable cell (<spanclass="version">v2.17.8</span>)
<divclass="collapsible">
<br>
When a table cell is formatted as follows:
<preclass="prettyprint lang-html"><td>
John
</td></pre>All carriage returns and tab(s) within the table cell would be included before editing. Once the contenteditable element has focus, the content is cleaned up.<br>
<br>
If this option is <code>true</code>, this widget will trim content <em>upon initialization</em>; this is necessary if you need cleaned it up content before editing, like with an autocomplete script.<br>
<td>Wrap the editable cell content with this element (<spanclass="version">v2.17.8</span>)
<divclass="collapsible">
<br>
Internally, the widget uses jQuery's <code>wrapInner</code> to wrap the cell contents, using the following rules:
<ul>
<li>If this option is set to <code>false</code> or an empty string (<code>''</code>), then no wrapping will occur. The "contenteditable" attribute will be applied to the table cell.</li>
<li>If the table cell has no children, then the content is wrapped using this option, and the wrapping element will have the "contentediable" attribute enabled.</li>
<li>If the cell already has children (one or more) immediately inside of the table cell, no wrapping occurs and the child element(s) that don't have the class name set in <code>editable_noEdit</code>, will have the "contenteditable" attribute enabled.</li>
</ul>
Note: that this option uses jQuery's <code>wrapInner</code>, so this option can be set to a html string or selector, jQuery object, DOM element, or a function (jQuery 1.4+)