Skip to content

Commit

Permalink
Merge branch '0.8.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
warpech committed Mar 8, 2013
2 parents f27b73d + 6dc6498 commit 8151891
Show file tree
Hide file tree
Showing 23 changed files with 1,669 additions and 925 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
node_modules
.idea
.idea
_SpecRunner.html
.grunt

9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: node_js

node_js:
- "0.8"

before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- "npm install -g grunt-cli"
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## HEAD

Features:
- this may be a **breaking change** for some applications. Now the third parameter to the `alter` method tells the amount of rows/columns to be inserted/removed. This adds more consistency to the API. ([#368](https://github.com/warpech/jquery-handsontable/issues/368))
- merged pull request [#474](https://github.com/warpech/jquery-handsontable/pull/474) - Travis-CI integration. The tests don't pass yet but don't worry about it yet. It is a work in progress on complete test automation. Making all tests pass on Travis CI headless browser may take few more days or weeks :)

Bugfix:
- again, this may be a **breaking change** for some applications. Fix very long standing inconsistency. Restored original `setDataAtCell` requirement of the second parameter to be a column number (as described in [README.md](https://github.com/warpech/jquery-handsontable) since always). If you happen to experience an error in `setDataAtCell` after upgrade, change your usage of this method to the new method `setDataAtRowProp` ([#284](https://github.com/warpech/jquery-handsontable/pull/284))
- new methods `setDataAtRowProp` and `getDataAtRowProp` that set/get data according to the property name in data source. See [README.md](https://github.com/warpech/jquery-handsontable) for clarification
- merged pull request [#266](https://github.com/warpech/jquery-handsontable/pull/266) - fix countCols for arrays with column settings

## [0.8.10](https://github.com/warpech/jquery-handsontable/tree/v0.8.10) (Mar 7, 2013)

Bugfix:
Expand Down
149 changes: 99 additions & 50 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,72 +21,94 @@
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
dist: {
src: [
'tmp/intro.js',

'tmp/core.js',
'src/tableView.js',
'src/helpers.js',
'src/fillHandle.js',
'src/undoRedo.js',
'src/selectionPoint.js',

'src/renderers/textRenderer.js',
'src/renderers/autocompleteRenderer.js',
'src/renderers/checkboxRenderer.js',
'src/renderers/numericRenderer.js',

'src/editors/textEditor.js',
'src/editors/autocompleteEditor.js',
'src/editors/checkboxEditor.js',
'src/editors/dateEditor.js',
meta: {
src: [
'tmp/core.js',
'src/tableView.js',
'src/helpers.js',
'src/fillHandle.js',
'src/undoRedo.js',
'src/selectionPoint.js',

'src/cellTypes.js',
'src/renderers/textRenderer.js',
'src/renderers/autocompleteRenderer.js',
'src/renderers/checkboxRenderer.js',
'src/renderers/numericRenderer.js',

'src/pluginHooks.js',
'src/plugins/autoColumnSize.js',
'src/plugins/columnSorting.js',
'src/plugins/contextMenu.js',
'src/plugins/legacy.js',
'src/plugins/manualColumnMove.js',
'src/plugins/manualColumnResize.js',
'src/editors/textEditor.js',
'src/editors/autocompleteEditor.js',
'src/editors/checkboxEditor.js',
'src/editors/dateEditor.js',

'src/cellTypes.js',

'src/3rdparty/jquery.autoresize.js',
'src/3rdparty/sheetclip.js',
'src/3rdparty/walkontable.js',
'src/3rdparty/copypaste.js',
'src/pluginHooks.js',
'src/plugins/autoColumnSize.js',
'src/plugins/columnSorting.js',
'src/plugins/contextMenu.js',
'src/plugins/legacy.js',
'src/plugins/manualColumnMove.js',
'src/plugins/manualColumnResize.js',

'src/outro.js'
],
dest: 'jquery.handsontable.js'
'src/3rdparty/jquery.autoresize.js',
'src/3rdparty/sheetclip.js',
'src/3rdparty/walkontable.js',
'src/3rdparty/copypaste.js',
],
vendor: [
'lib/bootstrap-typeahead.js',
'lib/numeral.js',
'lib/jQuery-contextMenu/jquery.contextMenu.js'
// seems to have no effect when turned off on contextmenu.html
//'lib/jQuery-contextMenu/jquery.ui.position.js'
]
},

concat: {
dist: {
files: {
'jquery.handsontable.js': [
'tmp/intro.js',
'<%= meta.src %>',
'src/outro.js'
]
}
},
full_js: {
src: [
'jquery.handsontable.js',
'lib/bootstrap-typeahead.js',
'lib/numeral.js',
'lib/jQuery-contextMenu/jquery.contextMenu.js'
//'lib/jQuery-contextMenu/jquery.ui.position.js' //seems to have no effect when turned off on contextmenu.html
],
dest: 'dist/jquery.handsontable.full.js'
files: {
'dist/jquery.handsontable.full.js': [
'jquery.handsontable.js',
'<%= meta.vendor %>'
]
}
},
full_css: {
src: [
'jquery.handsontable.css',
'lib/jQuery-contextMenu/jquery.contextMenu.css'
],
dest: 'dist/jquery.handsontable.full.css'
files: {
'dist/jquery.handsontable.full.css': [
'jquery.handsontable.css',
'lib/jQuery-contextMenu/jquery.contextMenu.css'
]
}
}
},

watch: {
files: ['src/*', 'src/editors/*', 'src/plugins/*', 'src/renderers/*', 'src/3rdparty/*', 'src/css/*', 'lib/*'],
files: [
'src/*',
'src/editors/*',
'src/plugins/*',
'src/renderers/*',
'src/3rdparty/*',
'src/css/*',
'lib/*'
],
tasks: ['replace', 'concat', 'clean']
},

clean: {
dist: ['tmp']
},

replace: {
dist: {
options: {
Expand All @@ -101,14 +123,41 @@ module.exports = function (grunt) {
'jquery.handsontable.css': 'src/css/jquery.handsontable.css'
}
}
},

jasmine: {
src: [
'lib/jquery.min.js',
// '<%= meta.src %>',
'jquery.handsontable.js',
'lib/bootstrap-typeahead.js',
'lib/numeral.js',
'lib/jQuery-contextMenu/jquery.contextMenu.js',
'test/jasmine/spec/SpecHelper.js'
],
options: {
specs: [
'test/jasmine/spec/*Spec.js',
'test/jasmine/spec/*/*Spec.js'
],
template: 'test/JqueryHandsontableRunner.tmpl',
templateOptions: {
css: [
'lib/jQuery-contextMenu/jquery.contextMenu.css',
'jquery.handsontable.css',
]
}
}
}
});

// Default task.
grunt.registerTask('default', ['replace', 'concat', 'clean']);
grunt.registerTask('test', ['default', 'jasmine']);

grunt.loadNpmTasks('grunt-replace');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jasmine');
};
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ Thanks for understanding!
handsontable('updateSettings', options) | Method | Use it if you need to change configuration after initialization
handsontable('loadData', data) | Method | Reset all cells in the grid to contain data from the `data` array
handsontable('render') | Method | Rerender the table
handsontable('setDataAtCell',&nbsp;row,&nbsp;col,&nbsp;value) | Method | Set new value to a cell. To change many cells at once, pass an array of changes in format [[row, col, value], ...] as the only parameter
handsontable('getDataAtCell', row, col) | Method | Return cell value at `row`, `col`
handsontable('setDataAtCell',&nbsp;row,&nbsp;col,&nbsp;value) | Method | Set new value to a cell. To change many cells at once, pass an array of changes in format [[row, col, value], ...] as the only parameter. Col is the index of **visible** column (note that if columns were reordered, the current order will be used)
handsontable('setDataAtRowProp',&nbsp;row,&nbsp;prop,&nbsp;value) | Method | Same as above, except instead of `col`, you provide name of the object property (eq. [0, 'first.name', 'Jennifer'])
handsontable('getDataAtCell', row, col) | Method | Return cell value at `row`, `col`. Col is the index of **visible** column (note that if columns were reordered, the current order will be used)
handsontable('getDataAtRowProp', row, prop) | Method | Same as above, except instead of `col`, you provide name of the object property (eq. [0, 'first.name'])
handsontable('countRows') | Method | Return total number of rows in the grid
handsontable('countCols') | Method | Return total number of columns in the grid
handsontable('rowOffset') | Method | Return index of first visible row
Expand All @@ -69,10 +71,10 @@ Thanks for understanding!
handsontable('clear') | Method | Empty all cells
handsontable('clearUndo') | Method | Clear undo history
handsontable('getData', [r, c, r2, c2]) | Method | Return the current data object (the same that was passed by `data` configuration option or `loadData` method). Optionally you can provide cell range `r`, `c`, `r2`, `c2` to get only a fragment of grid data
handsontable('alter', 'insert_row', index) | Method | Insert new row above the row at given index
handsontable('alter', 'insert_col', index) | Method | Insert new column before the column at given index
handsontable('alter',&nbsp;'remove_row',&nbsp;index,&nbsp;[toIndex]) | Method | Remove the row at given index [optionally to another index]
handsontable('alter',&nbsp;'remove_col',&nbsp;index,&nbsp;[toIndex]) | Method | Remove the column at given index [optionally to another index]
handsontable('alter', 'insert_row', amount) | Method | Insert new row(s) above the row at given `index`. Default `amount` equals 1
handsontable('alter', 'insert_col', amount) | Method | Insert new column(s) before the column at given `index`. Default `amount` equals 1
handsontable('alter',&nbsp;'remove_row',&nbsp;index,&nbsp;amount) | Method | Remove the row(s) at given `index`. Default `amount` equals 1
handsontable('alter',&nbsp;'remove_col',&nbsp;index,&nbsp;amount) | Method | Remove the column(s) at given `index`. Default `amount` equals 1
handsontable('getCell', row, col) | Method | Return &lt;td&gt; element for given `row,col`
handsontable('getCellMeta', row, col) | Method | Return cell properties for given `row`, `col` coordinates
handsontable('selectCell', r, c, [r2, c2, scrollToSelection=true]) | Method | Select cell `r,c` or range finishing at `r2,c2`. By default, viewport will be scrolled to selection
Expand Down Expand Up @@ -131,8 +133,8 @@ The table below presents configuration options that are interpreted by `handsont
`currentColClassName` | string | _undefined_ | Class name for all visible columns in current selection
`onSelection` | function(`r`, `c`, `r2`, `c2`) | _undefined_ | Callback fired before one or more cells is selected. You can call `updateSettings` from inside, e.g. if you want to disable fillHandle for a specific cell. Parameters: <ul><li>`r` selection start row</li><li>`c` selection start column</li><li>`r2` selection end column</li><li>`c2` selection end column</li></ul>
`onSelectionByProp` | function(`r`, `p`, `r2`, `p2`) | _undefined_ | The same as above, but data source object property name is used instead of the column number
`onBeforeChange` | function(`changes`) | _undefined_ | Callback fired before one or more cells is changed. Its main purpose is to validate the input. Parameters: <ul><li>`changes` is a 2D array containing information about each of the edited cells `[ [row, col, oldVal, newVal], ... ]`. You can disregard a single change by setting `changes[i][3]` to false, or cancel all edit by returning false.</li></ul>
`onChange` | function(`changes`, `source`) | _undefined_ | Callback fired after one or more cells is changed. Its main use case is to save the input. Parameters: <ul><li>`changes` is a 2D array containing information about each of the edited cells `[ [row, col, oldVal, newVal], ... ]`. </li><li>`source` is one of the strings: `"alter"`, `"empty"`, `"edit"`, `"populateFromArray"`, `"loadData"`, `"autofill"`, `"paste"`.</li></ul> Note: for performance reasone, the `changes` array is null for `"loadData"` source.
`onBeforeChange` | function(`changes`) | _undefined_ | Callback fired before one or more cells is changed. Its main purpose is to validate the input. Parameters: <ul><li>`changes` is a 2D array containing information about each of the edited cells `[ [row, prop, oldVal, newVal], ... ]`. You can disregard a single change by setting `changes[i][3]` to false, or cancel all edit by returning false.</li></ul>
`onChange` | function(`changes`, `source`) | _undefined_ | Callback fired after one or more cells is changed. Its main use case is to save the input. Parameters: <ul><li>`changes` is a 2D array containing information about each of the edited cells `[ [row, prop, oldVal, newVal], ... ]`. </li><li>`source` is one of the strings: `"alter"`, `"empty"`, `"edit"`, `"populateFromArray"`, `"loadData"`, `"autofill"`, `"paste"`.</li></ul> Note: for performance reasone, the `changes` array is null for `"loadData"` source.
`onCopyLimit` | function() | _undefined_ | Callback fired if `copyRowsLimit` or `copyColumnsLimit` was reached. Callback parameters are: `selectedRowsCount`, `selectedColsCount`, `copyRowsLimit`, `copyColsLimit`

## Similar projects
Expand Down Expand Up @@ -169,3 +171,9 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## Travis CI status

[![Build Status](https://travis-ci.org/warpech/jquery-handsontable.png?branch=master)](https://travis-ci.org/warpech/jquery-handsontable)

**Note:** Travis CI build fails because Handsontable test suite is not fully adjusted to run in Travis CI headless browser. Integration with Travis CI is a work in progress since Handsontable 0.8.11. It may take few more weeks until we are fully compatible. See pull request [#474](https://github.com/warpech/jquery-handsontable/pull/474) for more details.
2 changes: 1 addition & 1 deletion dist/jquery.handsontable.full.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Licensed under the MIT license.
* http://handsontable.com/
*
* Date: Thu Mar 07 2013 10:13:24 GMT+0100 (Central European Standard Time)
* Date: Fri Mar 08 2013 01:14:54 GMT+0100 (Central European Standard Time)
*/

.handsontable {
Expand Down
Loading

0 comments on commit 8151891

Please sign in to comment.