Last active
December 16, 2015 09:09
-
-
Save dervalp/5410714 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(["sitecore"], function (_sc) { | |
_sc.Factories.createBaseComponent({ | |
name: "Buttongroup", | |
base: "BlockBase", | |
selector: ".sc-button-group", | |
attributes: [ | |
{ name: "commands", defaultValue: [] } | |
], | |
initialize: function () { | |
this._super(); | |
}, | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model RenderingModel | |
@{ | |
var userControl = this.Html.Sitecore().Controls().GetUserControl(this.Model.Rendering); | |
userControl.Class = “sc-button-group”; | |
} | |
<div @htmlAttributes> | |
<div class="btn-group" data-bind="foreach: actionButtonsViewModel.commands"> | |
<button class="btn" data-bind="text: Title, attr: { class: Style, 'data-type': Category, 'data-itemuri': $root.ItemUri, 'data-command': Value }"></button> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.DataTable.on("change:selectedCommands", function () { | |
var commands = this.DataTable.get("selectedCommands"); | |
//ID_OF_THE_BUTTONGROUP is the one in showed in ROCKS | |
this.ID_OF_THE_BUTTONGROUP.set("commands", commands); | |
}, this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment