Hi,
I have a split button (below), when I click on a RadMenuItem i'd like to postback immediately rather than changing the button text and the user then requiring to click again, how would I accomplish this?
I have a split button (below), when I click on a RadMenuItem i'd like to postback immediately rather than changing the button text and the user then requiring to click again, how would I accomplish this?
<
telerik:RadButton
ID
=
"CloneSplitButton"
AutoPostBack
=
"false"
runat
=
"server"
Text
=
"Clone"
EnableSplitButton
=
"true"
Height
=
"22px"
Enabled
=
"true"
CommandName
=
"SaveReturn"
UseSubmitBehavior
=
"false"
OnClientClicked
=
"OnClientCloneSplitButtonClicked"
OnClick
=
"CloneSplitButton_Click"
>
</
telerik:RadButton
>
<
telerik:RadContextMenu
ID
=
"CloneContextMenu"
runat
=
"server"
OnClientItemClicked
=
"OnClientCloneContextMenuClicked"
EnableRoundedCorners
=
"true"
>
<
Items
>
<
telerik:RadMenuItem
Text
=
"New Quick Quote"
/>
<
telerik:RadMenuItem
Text
=
"New Subscription"
/>
</
Items
>
</
telerik:RadContextMenu
>
<
telerik:RadCodeBlock
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function OnClientCloneSplitButtonClicked(sender, args) {
if (args.IsSplitButtonClick()) {
var currentLocation = $telerik.getLocation(sender.get_element());
var contextMenu = $find("<%= CloneContextMenu.ClientID %>");
contextMenu.showAt(currentLocation.x, currentLocation.y + 22);
sender.set_autoPostBack(false);
}
else {
sender.set_autoPostBack(true);
window.setTimeout(function () {
sender.set_enabled(false);
}, 0);
}
}
function OnClientCloneContextMenuClicked(sender, args) {
var itemText = args.get_item().get_text();
var splitButton = $find("<%= CloneSplitButton.ClientID %>");
if (itemText == "New Quick Quote") {
splitButton.set_text("Clone to New Quick Quote");
splitButton.set_commandName("CloneQuickQuote");
}
else {
splitButton.set_text("Clone to New Subscription");
splitButton.set_commandName("CloneSubscription");
}
}
</
script
>
</
telerik:RadCodeBlock
>