I got what I wanted working very quickly because the control works well but got stuck on the last feature. I had a tree that the user could click on but they wanted edit|delete|view option and I added that easily. But I wanted a confirmation on the delete. I tried to catch the OnClientContextMenuItemClicked but then there is no functionality on the tree at all and it looks like I have to handle it all myself. The only other option is going through the postback to raise a new dialog to ask for confirmation.
Anyone have a quicker way to do this? All I want to do is confirm the delete option.
Stephen
Updated: ok, I must have done something wrong because I can call the clientside function and it still acts properly. Is there a way I can change what happens after I return from the client side function. What I'd like it to be able to affect or cancel the server side post under certain conditions.
Updated: ok, never mind, this was as simple as I had hoped it would be
function TestIt(sender, eventArgs) {
var item = eventArgs.get_menuItem();
if (item.get_text() == "Delete") {
if (!confirm("Do you really want to delete that item")) {
eventArgs.set_cancel(true);
}
}
Anyone have a quicker way to do this? All I want to do is confirm the delete option.
Stephen
Updated: ok, I must have done something wrong because I can call the clientside function and it still acts properly. Is there a way I can change what happens after I return from the client side function. What I'd like it to be able to affect or cancel the server side post under certain conditions.
Updated: ok, never mind, this was as simple as I had hoped it would be
function TestIt(sender, eventArgs) {
var item = eventArgs.get_menuItem();
if (item.get_text() == "Delete") {
if (!confirm("Do you really want to delete that item")) {
eventArgs.set_cancel(true);
}
}