It would be nice to be able to add additional attributes to the markup rendered by HGrid.Fmt.button. The use case in the issue above involves adding data-* attributes in order to apply tooltips to the buttons.
I propose the following API:
var buttonDef = {
text: 'Some text',
action: 'download',
cssClass: 'btn btn-primary',
// A new property that allows adding extra attributes
attributes: 'data-toggle="tooltip" data-original-title="Download"'
}
HGrid.Fmt.button(buttonDef)
// => <button data-hg-action="download"
// class="btn btn-primary" data-toggle="tooltip" data-original-title="Download">
// Some text
// </button>
Motivated by CenterForOpenScience/osf#978:
It would be nice to be able to add additional attributes to the markup rendered by
HGrid.Fmt.button
. The use case in the issue above involves addingdata-*
attributes in order to apply tooltips to the buttons.I propose the following API: