Beispiel #1
0
        /// <summary>
        /// 添加操作数据项
        /// 数据项的主键将用脚本参数 (默认 selectedId) 传递
        /// </summary>
        /// <param name="display">显示文字</param>
        /// <param name="script">脚本参数 (默认 selectedId)</param>
        /// <returns></returns>
        public IStaticTableItemAction <TModel> AddActionItem(string display, string script)
        {
            if (string.IsNullOrWhiteSpace(display))
            {
                throw new ArgumentNullException("display");
            }
            if (string.IsNullOrWhiteSpace(script))
            {
                throw new ArgumentNullException("script");
            }

            var action = new StaticTableAction <TModel>(display, script, LinkBehave.Script);

            ItemActions.Add(action);
            return(action);
        }
Beispiel #2
0
        /// <summary>
        /// 添加操作数据项
        /// 数据项的主键将用变量 (默认 selectedId) 传递
        /// </summary>
        /// <param name="location"></param>
        /// <returns></returns>
        public IStaticTableItemAction <TModel> AddActionItem(ILocation location)
        {
            if (location == null)
            {
                throw new ArgumentNullException("location");
            }
            if (location.Behave == LinkBehave.Script)
            {
                throw new ArgumentException("路径不能设置 LinkBehave.Script", "location.Behave");
            }

            var action = new StaticTableAction <TModel>(location.Display, location.Path, location.Behave);

            ItemActions.Add(action);
            return(action);
        }