|
<script id="customButtons" type="text/x-jsrender">
<div id="groupButton" style="width:350px"></div>
</script>
<ej-gantt id="resourceGantt"
[dataSource]="resourceGanttData"
(create)="create($event)"
[toolbarSettings]="toolbarSettings"
//..
>
</ej-gantt>
[TS]
constructor() {
this.toolbarSettings = {
showToolbar: true,
customToolbarItems: [{
templateID: "#customButtons",
}],
}
//..
}
create(sender) {
$("#groupButton").ejGroupButton({
groupButtonMode: "radiobutton",
dataSource: [
{ text: "Bold", contentType: "textonly" },
{ text: "Italic", contentType: "textonly" },
{ text: "UnderLine", contentType: "textonly" },
],
select: function (args) {
if (args.index == 0) {
console.log("Bold button gets clicked")
}
else if (args.index == 1)
console.log("Italic button gets clicked")
else
console.log("UnderLine button gets clicked") },
width: "300px",
showRoundedCorner: true
});
} |
|
<style>
.e-horizontal #resourceGantt_customButtons {
background:none !important;
}
</style> |
|
<style>
.e-horizontal .e-tooltxt {
background:none !important;
}
</style> |
|
[TS]
create(sender) {
$("#groupButton").ejGroupButton({
groupButtonMode: "radiobutton",
dataSource: [
{ text: "Bold", contentType: "textonly", htmlAttribute: { class: "bold" } },
{ text: "Italic", contentType: "textonly", htmlAttribute: { class: "italic" } },
{ text: "UnderLine", contentType: "textonly", htmlAttribute: { class: "underline" } },
],
select: function (args) {
if (args.index == 0) {
console.log("Bold button gets clicked")
}
else if (args.index == 1)
console.log("Italic button gets clicked")
else
console.log("UnderLine button gets clicked")
},
width: "180px", height: 40,
showRoundedCorner: true
});
}
[HTML]
<style>
.bold.e-grp-btn-item .e-btn-content {
width: 30px !important;
}
.italic.e-grp-btn-item .e-btn-content {
width: 30px !important;
}
.underline.e-grp-btn-item .e-btn-content {
width: 90px !important;
}
</style> |
|
[TS]
constructor() {
this.toolbarSettings = {
showToolbar: true,
customToolbarItems: [{
templateID: "#customButtons",
},
]
}
//..
}
[Index]
<script id="customButtons" type="text/x-jsrender">
<div id="groupButton"></div>
</script>
<style>
.e-horizontal #resourceGantt_customButtons {
background:none !important;
}
</style> |
|
[HTML]
<style>
#resourceGantt_customButtons #groupButton{
background-color:#fcfcfc !important;
}
</style> |