/// <summary> /// 设置右键菜单 /// </summary> /// <param name="gridId">表格Id</param> /// <param name="menuId">菜单Id</param> public T Menu(string gridId = "", string menuId = "") { var builder = new ParamBuilder(); builder.Add(gridId, "''", true); builder.Add(menuId, true); return(OnContextMenu(string.Format("{0}({1})", GetMenuFunction(), builder.GetResult()))); }
/// <summary> /// 设置右键菜单 /// </summary> /// <param name="treeId">树Id</param> /// <param name="menuId">菜单Id</param> public void Menu(string treeId = "", string menuId = "") { var builder = new ParamBuilder(); builder.Add(treeId, "''", true); builder.Add(menuId, true); OnContextMenu(string.Format("$.easyui.showTreeMenu_onContextMenu({0})", builder.GetResult())); }
/// <summary> /// 获取参数 /// </summary> private string GetParams(string formId, string gridId) { var builder = new ParamBuilder(); builder.Add(formId, "''", true); builder.Add(gridId, "''", true); return(builder.GetResult()); }
/// <summary> /// 获取添加参数 /// </summary> private string GetAddParams(object row, string gridId) { var builder = new ParamBuilder(); builder.Add(Json.ToJson(row, true)); builder.Add(gridId, "''", true); return(builder.GetResult()); }
/// <summary> /// 获取联动子控件参数 /// </summary> private string GetChildParams(string childId, string requestParam, string url) { var builder = new ParamBuilder(); builder.Add(childId, "''", true); builder.Add(requestParam, true); builder.Add(url, true); return(builder.GetResult()); }
/// <summary> /// 获取参数 /// </summary> private string GetParams(string url, string handler, string id, string message = "") { var builder = new ParamBuilder(); builder.Add(url, "''", true); builder.Add(handler, "null"); builder.Add(id, "''", true); builder.Add(message, "''", true); return(builder.GetResult()); }
/// <summary> /// 获取表单参数 /// </summary> private string GetSubmitParams(string beforeHandler, string successHandler, string formId, string treeId = "") { var builder = new ParamBuilder(); builder.Add(beforeHandler, "null"); builder.Add(successHandler, "null"); builder.Add(formId, "''", true); builder.Add(treeId, "''", true); return(builder.GetResult()); }
/// <summary> /// 单击刷新面板 /// </summary> /// <param name="panelId">面板编号</param> /// <param name="url">服务端Url</param> /// <param name="paramName">参数</param> /// <param name="fnCreateUrl">用于创建Url的回调函数</param> public void RefreshPanel(string panelId, string url, string paramName, string fnCreateUrl = "") { var builder = new ParamBuilder(); builder.Add(panelId, "''", true); builder.Add(url, "''", true); builder.Add(paramName, "''", true); builder.Add(fnCreateUrl, "null"); OnClick(string.Format("$.easyui.clickTreeNodeRefreshPanel_onClick({0})", builder.GetResult())); }
/// <summary> /// 获取行展开详细内容参数 /// </summary> private string GetDetailParams(string url, bool isShowBorder, string fnCreateUrl, string paramName, string btnDivId) { var builder = new ParamBuilder(); builder.Add(url, true); builder.Add(isShowBorder.ToStr().ToLower()); builder.Add(fnCreateUrl, "null"); builder.Add(paramName, true); builder.Add(btnDivId, true); return(builder.GetResult()); }
/// <summary> /// 获取添加参数 /// </summary> private string GetAddParams(object row, string gridId, string beforeHandler = "") { var builder = new ParamBuilder(); builder.Add(Json.ToJson(row, true)); builder.Add(gridId, "''", true); if (!beforeHandler.IsEmpty()) { builder.Add(beforeHandler); } return(builder.GetResult()); }
/// <summary> /// 设置右键菜单 /// </summary> /// <param name="treeId">树Id</param> /// <param name="menuId">菜单Id</param> public void Menu( string treeId = "", string menuId = "" ) { var builder = new ParamBuilder(); builder.Add( treeId, "''", true ); builder.Add( menuId, true ); OnContextMenu( string.Format( "$.easyui.showTreeMenu_onContextMenu({0})", builder.GetResult() ) ); }
/// <summary> /// 单击刷新面板 /// </summary> /// <param name="panelId">面板编号</param> /// <param name="url">服务端Url</param> /// <param name="paramName">参数</param> /// <param name="fnCreateUrl">用于创建Url的回调函数</param> public void RefreshPanel( string panelId, string url, string paramName, string fnCreateUrl = "" ) { var builder = new ParamBuilder(); builder.Add( panelId, "''", true ); builder.Add( url, "''", true ); builder.Add( paramName, "''", true ); builder.Add( fnCreateUrl, "null" ); OnClick( string.Format( "$.easyui.clickTreeNodeRefreshPanel_onClick({0})", builder.GetResult() ) ); }
public void TestSeparator() { _builder = new ParamBuilder( "'", ";" ); _builder.Add( "a" ); _builder.Add( "b" ); Assert.AreEqual( "a;b", _builder.GetResult() ); }
public void TestQuotes() { _builder = new ParamBuilder( "\"" ); _builder.Add( "a",true ); _builder.Add( "b" ); Assert.AreEqual( "\"a\",b", _builder.GetResult() ); }
public static ParamBuilder ViewAsPdf(this ParamBuilder builder, int value) { return(builder.Add(ParamNames.ViewAsPdf, value)); }
public static ParamBuilder UserGroup(this ParamBuilder builder, string key) { return(builder.Add(ParamNames.UserGroup, key)); }
public static ParamBuilder User(this ParamBuilder builder, Guid id) { return(builder.Add(ParamNames.User, id)); }
public void TestAdd_Empty() { _builder.Add(""); Assert.AreEqual("", _builder.GetResult()); }