Skip to content

Commit

Permalink
Remove references to the click-cell event
Browse files Browse the repository at this point in the history
  • Loading branch information
manolo committed Dec 15, 2016
1 parent 8d6c5b9 commit 4f13591
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/vaadin-grid-assigning-data.adoc
@@ -1,6 +1,6 @@
---
title: Assigning Data
order: 4
order: 1
layout: page
---

Expand Down
2 changes: 1 addition & 1 deletion docs/vaadin-grid-lazy-loading.adoc
@@ -1,6 +1,6 @@
---
title: Lazy Loading and Remote Data
order: 1
order: 2
layout: page
---

Expand Down
22 changes: 8 additions & 14 deletions docs/vaadin-grid-row-details.adoc
Expand Up @@ -76,16 +76,14 @@ grid.push('expandedItems', item); //expands row details for 'item'
[NOTE]
When modifying [propertyname]#expandedItems#, remember to use the array mutation methods from Polymer.Base

[[vaadin-grid.row-details.clicking]]
== Expanding and Collapsing Items on Click
[[vaadin-grid.row-details.activeitem]]
== Expanding and Collapsing Items on activation

You can listen to [propertyname]#cell-click# event which is fired when a user clicks on a *non-focusable* element
inside a cell. Event details contain a reference to the instance model of the cell which can be used
to access the item.
You can listen to [propertyname]#active-item-changed# event which is fired whenever a user activates a row in the grid. Then you can access the last activated item by using the `activeItem` of the grid.

[source,html]
----
<vaadin-grid id="grid" on-cell-click="_onCellClick">
<vaadin-grid id="grid" active-item-changed="_onActiveItemChanged">
<template class="row-details">
These are the details for [[item.value]]!
</template>
Expand All @@ -95,14 +93,10 @@ to access the item.
</vaadin-grid>
<script>
...
_onCellClick: function(e) {
var item = e.detail.model.item;
if (this.$.grid.expandedItems.indexOf(item) < -1) {
this.$.grid.expandItem(item);
} else {
this.$.grid.collapseItem(item);
}
_onActiveItemChanged: function(e) {
var item = e.detail.value;
this.$.grid.expandedItems = item ? [item] : [];
}
...
</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/vaadin-grid-selection.adoc
@@ -1,6 +1,6 @@
---
title: Selection
order: 3
order: 4
layout: page
---

Expand Down
2 changes: 1 addition & 1 deletion test/active-item.html
Expand Up @@ -60,7 +60,7 @@
clickItem(0);

clickItem(0);

expect(grid.activeItem).to.be.null;
});
});
Expand Down

0 comments on commit 4f13591

Please sign in to comment.