Hi,
I have a contextual menu associated with a tabstrip.
Here's the menu handler:
function
activityContextMenuClicked(sender, args) {
var
itemValue = args.get_item().get_value();
if
(itemValue ==
'new'
) {
openActivityDialog(
'new'
,
''
,
''
,
''
);
}
else
if
(itemValue ==
'edit'
) {
var
tabStrip = $find(
"<%= tbsActivities.ClientID %>"
);
var
tab = tabStrip._findItemByText(args.get_targetElement().innerHTML);
var
activityIDToUpdate = tab.get_value();
var
activityName = tab.get_text();
var
activityDesc = tab.get_attributes().getAttribute(
"Description"
);
openActivityDialog(
'edit'
, activityIDToUpdate, activityName, activityDesc);
}
else
if
(itemValue ==
'delete'
) {
var
tabStrip = $find(
"<%= tbsActivities.ClientID %>"
);
var
tab = tabStrip._findItemByText(args.get_targetElement().innerHTML);
activityIDToDelete = tab.get_value();
radconfirm(
"Are you really sure you want to delete this activity and all of its child elements?"
, deleteActivityResponse, 300, 100,
null
,
"Delete Activity"
,
null
);
}
}
I must mention that the tabstrip is built dynamically, so the text is variable.
The above code works fine unless the text contains an ampersand (I suspect other special characters may cause issues as well).
I tried using findItemByValue(args.get_targetElement().value), but that did not work either.
Any suggestions?
Thanks
Jim