/// <summary>
 /// 添加永久删除按钮
 /// 点击后弹出确认框,确认后把json=[数据Id]提交到永久删除url
 /// </summary>
 /// <param name="column">操作列</param>
 /// <param name="typeName">类型名称</param>
 /// <param name="deleteForeverUrl">永久删除使用的Url</param>
 /// <param name="name">名称,不指定时使用默认值</param>
 /// <param name="buttonClass">按钮的Css类,不指定时使用默认值</param>
 /// <param name="iconClass">图标的Css类,不指定时使用默认值</param>
 /// <param name="titleTemplate">标题的模板,格式是underscore.js的格式,参数传入rows</param>
 /// <param name="urlTemplate">编辑Url的模板,格式是underscore.js的格式,参数传入rows</param>
 /// <param name="primaryKey">数据Id保存的名称,不指定时使用默认值</param>
 /// <param name="dialogParameters">弹出框的参数,不指定时使用默认值</param>
 public static void AddDeleteForeverAction(
     this AjaxTableActionColumn column, string typeName, string deleteForeverUrl,
     string name          = null, string buttonClass      = null, string iconClass = null,
     string titleTemplate = null, string urlTemplate      = null,
     string primaryKey    = null, object dialogParameters = null)
 {
     primaryKey = primaryKey ?? nameof(IEntity <Guid> .Id);
     column.AddConfirmActionForBelongedRow(
         name ?? new T("Delete Forever"),
         buttonClass ?? "btn btn-xs btn-danger",
         iconClass ?? "fa fa-remove",
         titleTemplate ?? string.Format(new T("Delete {0} Forever"), new T(typeName)),
         BaseScriptStrings.ConfirmMessageTemplateForMultiSelected(
             string.Format(new T("Sure to delete following {0} forever?"), new T(typeName)), "ToString"),
         BaseScriptStrings.PostConfirmedActionForMultiSelected(primaryKey, deleteForeverUrl),
         dialogParameters ?? new { type = "type-danger" });
 }
Beispiel #2
0
 /// <summary>
 /// 添加删除按钮
 /// 点击后弹出确认框,确认后把json=[数据Id]提交到删除url
 /// </summary>
 /// <param name="column">操作列</param>
 /// <param name="typeName">类型名称</param>
 /// <param name="deleteUrl">删除使用的Url</param>
 /// <param name="name">名称,不指定时使用默认值</param>
 /// <param name="buttonClass">按钮的Css类,不指定时使用默认值</param>
 /// <param name="iconClass">图标的Css类,不指定时使用默认值</param>
 /// <param name="titleTemplate">标题的模板,格式是underscore.js的格式,参数传入rows</param>
 /// <param name="urlTemplate">编辑Url的模板,格式是underscore.js的格式,参数传入rows</param>
 /// <param name="primaryKey">数据Id保存的名称,不指定时使用默认值</param>
 /// <param name="dialogParameters">弹出框的参数,不指定时使用默认值</param>
 public static void AddDeleteAction(
     this AjaxTableActionColumn column, string typeName, string deleteUrl,
     string name          = null, string buttonClass      = null, string iconClass = null,
     string titleTemplate = null, string urlTemplate      = null,
     string primaryKey    = null, object dialogParameters = null)
 {
     primaryKey = primaryKey ?? EntityTrait.For <object>().PrimaryKey;
     column.AddConfirmActionForBelongedRow(
         name ?? new T("Delete"),
         buttonClass ?? "btn btn-xs btn-danger",
         iconClass ?? "fa fa-remove",
         titleTemplate ?? string.Format(new T("Delete {0}"), new T(typeName)),
         ScriptStrings.ConfirmMessageTemplateForMultiSelected(
             string.Format(new T("Sure to delete following {0}?"), new T(typeName)), "ToString"),
         ScriptStrings.PostConfirmedActionForMultiSelected(primaryKey, deleteUrl),
         dialogParameters);
 }
 /// <summary>
 /// 添加恢复按钮
 /// 点击后弹出确认框,确认后把json=[数据Id]提交到恢复url
 /// </summary>
 /// <param name="column">操作列</param>
 /// <param name="typeName">类型名称</param>
 /// <param name="recoverUrl">恢复使用的Url</param>
 /// <param name="name">名称,不指定时使用默认值</param>
 /// <param name="buttonClass">按钮的Css类,不指定时使用默认值</param>
 /// <param name="iconClass">图标的Css类,不指定时使用默认值</param>
 /// <param name="titleTemplate">标题的模板,格式是underscore.js的格式,参数传入rows</param>
 /// <param name="urlTemplate">编辑Url的模板,格式是underscore.js的格式,参数传入rows</param>
 /// <param name="primaryKey">数据Id保存的名称,不指定时使用默认值</param>
 /// <param name="dialogParameters">弹出框的参数,不指定时使用默认值</param>
 public static void AddRecoverAction(
     this AjaxTableActionColumn column, string typeName, string recoverUrl,
     string name          = null, string buttonClass      = null, string iconClass = null,
     string titleTemplate = null, string urlTemplate      = null,
     string primaryKey    = null, object dialogParameters = null)
 {
     primaryKey = primaryKey ?? nameof(IEntity <Guid> .Id);
     column.AddConfirmActionForBelongedRow(
         name ?? new T("Recover"),
         buttonClass ?? "btn btn-xs btn-info",
         iconClass ?? "fa fa-history",
         titleTemplate ?? string.Format(new T("Recover {0}"), new T(typeName)),
         BaseScriptStrings.ConfirmMessageTemplateForMultiSelected(
             string.Format(new T("Sure to recover following {0}?"), new T(typeName)), "ToString"),
         BaseScriptStrings.PostConfirmedActionForMultiSelected(primaryKey, recoverUrl),
         dialogParameters);
 }