Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

Commit

Permalink
v0.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Mobius1 committed Oct 6, 2017
1 parent ec0f479 commit 9c4a471
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 12 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ datatable.editable.saveCell("Foobar");


### `saveRow(data, row)`
Set the new content of a row. Just pass a reference to the row as the first argument and the new content of the cells as the second.
Set the new content of a row. Just pass the new row data as the first argument and a reference to the row as the second

This can be used to either close and save a row that is currently in edit mode (as above) or for quickly setting the content of the row.

Expand Down Expand Up @@ -243,6 +243,17 @@ datatable.editable.saveRow(["foo", "bar", "baz", "qux"]);

## Changelog

`v0.0.9`

* Change event name:
* `datatable.editable.init` -> `editable.init`

* Add events:
* `editable.save.cell`
* `editable.save.row`
* `editable.context.open`
* `editable.context.close`

`v0.0.8`

* Allow `saveCell()` and `saveRow()` methods to save the current cell/row
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vanilla-datatables-editable",
"version": "0.0.8",
"version": "0.0.9",
"main": "datatable.editable.min.js",
"ignore": [
".gitattributes",
Expand Down
4 changes: 2 additions & 2 deletions datatable.editable.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*! Editable 0.0.7
/*! Editable 0.0.9
* © 2016-2017 Karl Saunders
*/
/**
* @summary Editable
* @description Allow editing of cells and rows
* @version 0.0.7
* @version 0.0.9
* @file datatable.editable.js
* @author Karl Saunders
* @contact [email protected]
Expand Down
17 changes: 14 additions & 3 deletions datatable.editable.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*! Editable 0.0.8
/*! Editable 0.0.9
* © 2016-2017 Karl Saunders
*/
/**
* @summary Editable
* @description Allow editing of cells and rows
* @version 0.0.8
* @version 0.0.9
* @file datatable.editable.js
* @author Karl Saunders
* @contact [email protected]
Expand Down Expand Up @@ -50,6 +50,9 @@ if (window.DataTable && typeof window.DataTable === "function") {
separator: "datatable-editor-separator"
},

// include hidden columns in the editor
hiddenColumns: false,

// enable th context menu
contextMenu: true,

Expand Down Expand Up @@ -207,7 +210,7 @@ if (window.DataTable && typeof window.DataTable === "function") {
that.bindEvents();

setTimeout(function() {
instance.emit("datatable.editable.init");
instance.emit("editable.init");
}, 10);
};

Expand Down Expand Up @@ -367,6 +370,8 @@ if (window.DataTable && typeof window.DataTable === "function") {

this.data = {};
this.editing = this.editingCell = false;

instance.emit("editable.save.cell");
};

/**
Expand Down Expand Up @@ -471,6 +476,8 @@ if (window.DataTable && typeof window.DataTable === "function") {
instance.columns().rebuild();

this.closeModal();

instance.emit("editable.save.row");
};

/**
Expand Down Expand Up @@ -568,6 +575,8 @@ if (window.DataTable && typeof window.DataTable === "function") {
if (this.config.contextMenu) {
document.body.appendChild(this.container);
this.closed = false;

instance.emit("editable.context.open");
}
};

Expand All @@ -579,6 +588,8 @@ if (window.DataTable && typeof window.DataTable === "function") {
if (this.config.contextMenu && !this.closed) {
this.closed = true;
document.body.removeChild(this.container);

instance.emit("editable.context.close");
}
};

Expand Down
2 changes: 1 addition & 1 deletion datatable.editable.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9c4a471

Please sign in to comment.