Telerik UI for ASP。NET MVC?下载30天免费试用

FileManager中的ContextMenu

用于ASP的Telerik UI。NET MVC文件管理's ContextMenu enables you to easily execute FileManager commands on the selected file or folder.

该组件为ASP使用Telerik UI。NET MVCContextMenu, enabling you to get full advantage of its客户端API.一旦选择了一个项目,就会执行相应的命令。

ContextMenu中的内置项是重命名而且删除.您可以定义可以执行自定义命令的自定义项。您还可以管理哪些项应该可见,通过在组件的初始化中枚举所需的项(参见下面的示例)。

@(Html.Kendo(). filemanager (). name ("filemanager") . contextmenu (context => context. menu)Items(Items => {Items . add ("rename");items.Add(“删除”);}))…

自定义上下文菜单项

要向FileManager的上下文菜单中添加自定义命令,请遵循以下说明。自定义物品的数量没有限制。

  1. 添加项目,设置文本并指定命令名:

    . contextmenu (context => {context. menu)Items(Items => {Items . add ("rename");items.Add(“删除”);items.Add(“自定义”)。文本(“自定义按钮”).Command(“MyCustomCommand”);});})
  2. 为FileManager创建命令:

    $(function(){var filemanagerNS = kendo.ui.filemanager;filemanagern .commands. mycustomcommand = filemanagern . filemanagercommand。Extend ({exec: function () {var that = this, filemanager = that。filemanager, //获取kendo.ui.FileManager实例选项=那个。Options, //获取通过target = Options工具传递的选项。目标//选项。target仅当从上下文菜单执行命令时可用selectedFiles = filemanager.getSelected();console.log(options. log)arg, target, selectedFiles);//执行自定义命令的逻辑。}});});

另请参阅

在本文中
Baidu
map