Skip to content

Commit

Permalink
#46 Added Child Toggle to Row (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
madmax983 committed Mar 29, 2018
1 parent 2dffd37 commit 0c66eeb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions force-app/main/default/aura/row/row.cmp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
description="Row Index" />
<aura:attribute name="cellDecorators" type="Aura.ComponentDefRef[]" access="public"/>
<aura:attribute name="cellEditors" type="Aura.ComponentDefRef[]" access="public"/>
<aura:method name="toggleChildren" action="{!c.childrenToggle}"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<tr id="{!'ltng-grid-row-' + v.indexVar}"
class="slds-hint-parent"
Expand Down
4 changes: 4 additions & 0 deletions force-app/main/default/aura/row/rowController.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
doInit: function(component, event) {
var rowData = component.get("v.rowData");
component.set("v.childrenVisible", rowData.expanded);
},
childrenToggle: function(component) {
var cells = component.find("cells");
cells[0].toggleChildren();
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe("Grid Tests", function() {
var grid = cmp.find("exampleGrid");
var rows = grid.find("rows");
var cells = rows[9].find("cells");
cells[0].toggleChildren();
rows[9].toggleChildren();

return $T.waitFor(function() {
var grid = cmp.find("exampleGrid");
Expand Down

0 comments on commit 0c66eeb

Please sign in to comment.