mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
update editable widget docs
This commit is contained in:
parent
09d0961648
commit
adda82fbf0
@ -29,8 +29,8 @@ td.no-edit, span.no-edit {
|
||||
|
||||
<script id="js">$(function() {
|
||||
|
||||
// call the tablesorter plugin
|
||||
$("table").tablesorter({
|
||||
$("table")
|
||||
.tablesorter({
|
||||
theme : 'blue',
|
||||
|
||||
widgets: ['editable'],
|
||||
@ -38,8 +38,24 @@ td.no-edit, span.no-edit {
|
||||
editable_columns : [0,1,2], // point to the columns to make editable (zero-based index)
|
||||
editable_enterToAccept : true, // press enter to accept content, or click outside if false
|
||||
editable_autoResort : false, // auto resort after the content has changed.
|
||||
editable_noEdit : 'no-edit' // class name of cell that is not editable
|
||||
editable_noEdit : 'no-edit', // class name of cell that is not editable
|
||||
editable_editComplete : 'editComplete' // event fired after the table content has been edited
|
||||
}
|
||||
})
|
||||
.children('tbody').on('editComplete', 'td', function(){
|
||||
var $this = $(this),
|
||||
$allRows = $this.closest('table')[0].config.$tbodies.children('tr'),
|
||||
|
||||
newContent = $this.text(),
|
||||
cellIndex = this.cellIndex, // there shouldn't be any colspans in the tbody
|
||||
rowIndex = $allRows.index( $this.closest('tr') );
|
||||
/*
|
||||
$.post("mysite.php", {
|
||||
"row" : rowIndex,
|
||||
"cell" : cellIndex,
|
||||
"content" : newContent
|
||||
});
|
||||
*/
|
||||
});
|
||||
|
||||
});</script>
|
||||
@ -66,6 +82,7 @@ td.no-edit, span.no-edit {
|
||||
<li><code>editable_enterToAccept</code> (<code>true</code>) - Makes the user press enter to accept the content within the editable table cell; if <code>false</code>, clicking outside the cell will accept the content.</li>
|
||||
<li><code>editable_autoResort</code> (<code>false</code>) - If <code>true</code> the column will resort (only if already sorted) after the content has been changed.</li>
|
||||
<li><code>editable_noEdit</code> (<code>'no-edit'</code>) - Class name on table cells to search for that are not to become editable. The search is only done within the columns set by the <code>editable_column</code> option.</li>
|
||||
<li><code>editable_editComplete</code> (<code>'editComplete'</code>) - Event fired after the table content has been edited.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Pressing escape while editing will cancel any changes.</li>
|
||||
|
Loading…
Reference in New Issue
Block a user