I can't figure out how i might fly out a split button programmatically. My toolbar has an "export" function that is controlled with a split button. I want the user to be able to click on any part of the button to expand the options. However, the out of the box functionality is set up to only show the options when the user clicks directly on the little arrow of the split button.
I've got a way to do it, but it feels a bit messy. What i'm doing right now is detecting the click on the main body of the split button, and then i have to set a timeout and fire both mouse down and mouse up on the arrow:
Is there a better way to accomplish this same thing?
I've got a way to do it, but it feels a bit messy. What i'm doing right now is detecting the click on the main body of the split button, and then i have to set a timeout and fire both mouse down and mouse up on the arrow:
var
btnClicked = e.target.closest(
".k-split-button"
);
var
btnSplitParent = btnClicked.closest(
".k-split-button"
);
if
(btnSplitParent.length > 0 && !btnClicked.hasClass(
"k-split-button-arrow"
)) {
setTimeout(
function
() {
btnSplitParent.find(
".k-split-button-arrow"
).mousedown();
btnSplitParent.find(
".k-split-button-arrow"
).mouseup();
}, 100);
}
Is there a better way to accomplish this same thing?
How does one:
// find .k-split-button element
When the button is from a click event on a kendoToolBar?