diff options
author | Denis Anisimov <denis@vaadin.com> | 2016-09-21 16:22:47 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-09-23 10:36:45 +0000 |
commit | 78130f1884d8ee7e55d0c19578c5088de2a34bba (patch) | |
tree | 2e37eb66185973e0383c786175669631b5a9cb26 /uitest/src/main/resources | |
parent | d078a5d7dbdeea3d1bc479e2e9bf12dab30630cb (diff) | |
download | vaadin-framework-78130f1884d8ee7e55d0c19578c5088de2a34bba.tar.gz vaadin-framework-78130f1884d8ee7e55d0c19578c5088de2a34bba.zip |
Migrate AbstractJavaScriptRenderer to the new Grid (#182).
Change-Id: Ic514875fab8d90484b3a73b073bcc9d53697de75
Diffstat (limited to 'uitest/src/main/resources')
3 files changed, 26 insertions, 2 deletions
diff --git a/uitest/src/main/resources/com/vaadin/tests/components/grid/myBeanJsRenderer.js b/uitest/src/main/resources/com/vaadin/tests/components/grid/myBeanJsRenderer.js index 5e7bde5ec7..9beeabb677 100644 --- a/uitest/src/main/resources/com/vaadin/tests/components/grid/myBeanJsRenderer.js +++ b/uitest/src/main/resources/com/vaadin/tests/components/grid/myBeanJsRenderer.js @@ -4,13 +4,16 @@ window.com_vaadin_tests_components_grid_MyBeanJSRenderer = function() { } this.render = function(cell, data) { - cell.element.innerHTML = 'Bean(' + data.integer + ', ' + data.string + ')' + if (!cell.renderedText) { + cell.element.innerHTML = 'Bean(' + data.integer + ', ' + data.string + ')'; + } } this.getConsumedEvents = function() { return ["click"] }; this.onBrowserEvent = function(cell, event) { - cell.element.innerHTML = "Clicked " + cell.rowIndex + " with key " + this.getRowKey(cell.rowIndex) +" at " + event.clientX; + cell.renderedText ="Clicked " + cell.rowIndex + " with key " + this.getRowKey(cell.rowIndex) +" at " + event.clientX; + cell.element.innerHTML=cell.renderedText; return true; } }
\ No newline at end of file diff --git a/uitest/src/main/resources/com/vaadin/v7/tests/components/grid/JavaScriptStringRenderer.js b/uitest/src/main/resources/com/vaadin/v7/tests/components/grid/JavaScriptStringRenderer.js new file mode 100644 index 0000000000..14266d3057 --- /dev/null +++ b/uitest/src/main/resources/com/vaadin/v7/tests/components/grid/JavaScriptStringRenderer.js @@ -0,0 +1,5 @@ +com_vaadin_v7_tests_components_grid_JavaScriptStringRenderer = function() { + this.render = function(cell, data) { + cell.element.textContent = data; + } +}
\ No newline at end of file diff --git a/uitest/src/main/resources/com/vaadin/v7/tests/components/grid/myBeanJsRenderer.js b/uitest/src/main/resources/com/vaadin/v7/tests/components/grid/myBeanJsRenderer.js new file mode 100644 index 0000000000..45aff71a7b --- /dev/null +++ b/uitest/src/main/resources/com/vaadin/v7/tests/components/grid/myBeanJsRenderer.js @@ -0,0 +1,16 @@ +window.com_vaadin_v7_tests_components_grid_MyBeanJSRenderer = function() { + this.init = function(cell) { + cell.element.setAttribute("column", cell.columnIndex); + } + + this.render = function(cell, data) { + cell.element.innerHTML = 'Bean(' + data.integer + ', ' + data.string + ')' + } + + this.getConsumedEvents = function() { return ["click"] }; + + this.onBrowserEvent = function(cell, event) { + cell.element.innerHTML = "Clicked " + cell.rowIndex + " with key " + this.getRowKey(cell.rowIndex) +" at " + event.clientX; + return true; + } +}
\ No newline at end of file |