<ej-ribbon css-class="custom" id="defaultRibbon" width="100%" allow-resizing="true" expand="expand" collapse="collapse">
………
………
</ej-ribbon> |
<script type="text/javascript">
function collapse(args) {
// Get the header element of ribbon
var header = $(".custom .e-box.e-header")[0];
var ele = document.createElement("SPAN");
header.appendChild(ele);
ele.style.marginLeft = 'auto';
ele.classList.add('e-icon');
ele.classList.add('e-arrow-sans-down');
ele.id = "expandIcon";
$('#expandIcon').click(function () {
var ribbonObj = $("#defaultRibbon").data("ejRibbon");
// Expand the header on icon click
ribbonObj.expand();
});
}
function expand(args) {
// Remove the expand icon once expanded
$("#expandIcon")[0].remove()
}
</script> |
function collapse(args) { // Get the header element of ribbon var header = $(".custom .e-box.e-header")[0]; var ele = document.createElement("SPAN"); header.appendChild(ele); ele.style.marginLeft = 'auto'; ele.classList.add('e-icon'); ele.classList.add('e-arrow-sans-down'); ele.id = "expandIcon"; $('#expandIcon').click(function () { var ribbonObj = $("#defaultRibbon").data("ejRibbon"); console.log($("#defaultRibbon")); console.log(ribbonObj); // Expand the header on icon click ribbonObj.expand(); }); } |
|