将项目添加到显示透明背景的 Telerik RadContextMenu
我的 asp.net 网页中有一个 RadContextMenu。该菜单有一些静态项目。
我从 javascript 添加了更多选项,仅此而已。
从 javascript 添加项目后,上下文菜单的右侧变得透明。
更多详细信息:
以下是 javascript 代码,我在现有的 rad 上下文菜单(即 RadMenu1)中添加了一些项目。 其中已经有一些项目,我在 javascript 中动态添加了一些项目,
function ContextMenuOpen(sender, args)
{
var menu = $find("m_c_RadMenu1");
if (IsMobileBrowser() == false)
{
var evt = args.get_domEvent();
}
menu.trackChanges();
var items = menu._getAllItems()
menu.get_items().clear();
//menu.commitChanges();
AddItem("Visit & View Details", "a");
if (selectedRow.findElement("lblTask") != null) {
var tasklist = selectedRow.findElement("lblTask").defaultValue;
var taskArray = tasklist.split(',');
for (i = 0; i < taskArray.length; i++) {
if (typeof (taskArray[i].split('~')[1]) == 'undefined') break;
AddItem("Perform " + taskArray[i].split('~')[1], taskArray[i].split('~')[0]);
}
//rb.AddItem(selectedRow.findElement("lblTask").innerText,4)
}
AddItem("Log an Incident", "b");
if (rb.isLocationSelected == false) {
AddItem("Log a Discrepancy", "c");
}
function AddItem(text, value) {
var menu = rb.GetMenu();
var item = rb.GetContextMenuItem(text);
if (item != null) return false;
var menuItem = new Telerik.Web.UI.RadMenuItem();
menuItem.set_text(text);
menuItem.set_value(value)
menu.trackChanges();
menu.get_items().add(menuItem);
menu.commitChanges();
return true;
}
一切顺利,但是新添加的上下文菜单在右侧显示透明背景,我发现它仅在存在文本的区域填充背景,在右侧的空白区域是透明的(参见附图)
有人知道怎么做吗删除这个透明背景?
I have a RadContextMenu in my asp.net web page. This menu has some static items.
I am adding few more options to it from javascript and thats it.
After adding items from javascript right side of contextmenu becomes transparent.
More details:
Following is the javascript code where I am adding few items in existing rad context menu i.e. RadMenu1.
There are few items already in it and I am adding few more items dynamically in javascript
function ContextMenuOpen(sender, args)
{
var menu = $find("m_c_RadMenu1");
if (IsMobileBrowser() == false)
{
var evt = args.get_domEvent();
}
menu.trackChanges();
var items = menu._getAllItems()
menu.get_items().clear();
//menu.commitChanges();
AddItem("Visit & View Details", "a");
if (selectedRow.findElement("lblTask") != null) {
var tasklist = selectedRow.findElement("lblTask").defaultValue;
var taskArray = tasklist.split(',');
for (i = 0; i < taskArray.length; i++) {
if (typeof (taskArray[i].split('~')[1]) == 'undefined') break;
AddItem("Perform " + taskArray[i].split('~')[1], taskArray[i].split('~')[0]);
}
//rb.AddItem(selectedRow.findElement("lblTask").innerText,4)
}
AddItem("Log an Incident", "b");
if (rb.isLocationSelected == false) {
AddItem("Log a Discrepancy", "c");
}
function AddItem(text, value) {
var menu = rb.GetMenu();
var item = rb.GetContextMenuItem(text);
if (item != null) return false;
var menuItem = new Telerik.Web.UI.RadMenuItem();
menuItem.set_text(text);
menuItem.set_value(value)
menu.trackChanges();
menu.get_items().add(menuItem);
menu.commitChanges();
return true;
}
Everything goes well , but the newly added context menu shows transparent background on rightside , I found it is filling the background only at the area where text is present , on empty area at rightside it is transparent (see attached image )
do anybody know how to remove this transparent background?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论