v4.2.3
This commit is contained in:
parent
8e116609c6
commit
b00e9fd413
@ -355,7 +355,10 @@ namespace FineUI
|
|||||||
|
|
||||||
if (ShowHeader)
|
if (ShowHeader)
|
||||||
{
|
{
|
||||||
OB.AddProperty("title", String.IsNullOrEmpty(Title) ? String.Format("[{0}]", ID) : Title);
|
//OB.AddProperty("title", String.IsNullOrEmpty(Title) ? String.Format("[{0}]", ID) : Title);
|
||||||
|
|
||||||
|
OB.AddProperty("title", Title);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -122,6 +122,86 @@ namespace FineUI
|
|||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 最小高度
|
||||||
|
/// </summary>
|
||||||
|
[Category(CategoryName.OPTIONS)]
|
||||||
|
[DefaultValue(typeof(Unit), "")]
|
||||||
|
[Description("最小高度")]
|
||||||
|
public Unit MinHeight
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
object obj = FState["MinHeight"];
|
||||||
|
return obj == null ? Unit.Empty : (Unit)obj;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
FState["MinHeight"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 最小宽度
|
||||||
|
/// </summary>
|
||||||
|
[Category(CategoryName.OPTIONS)]
|
||||||
|
[DefaultValue(typeof(Unit), "")]
|
||||||
|
[Description("最小宽度")]
|
||||||
|
public Unit MinWidth
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
object obj = FState["MinWidth"];
|
||||||
|
return obj == null ? Unit.Empty : (Unit)obj;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
FState["MinWidth"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 最大高度
|
||||||
|
/// </summary>
|
||||||
|
[Category(CategoryName.OPTIONS)]
|
||||||
|
[DefaultValue(typeof(Unit), "")]
|
||||||
|
[Description("最大高度")]
|
||||||
|
public Unit MaxHeight
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
object obj = FState["MaxHeight"];
|
||||||
|
return obj == null ? Unit.Empty : (Unit)obj;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
FState["MaxHeight"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 最大宽度
|
||||||
|
/// </summary>
|
||||||
|
[Category(CategoryName.OPTIONS)]
|
||||||
|
[DefaultValue(typeof(Unit), "")]
|
||||||
|
[Description("最大宽度")]
|
||||||
|
public Unit MaxWidth
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
object obj = FState["MaxWidth"];
|
||||||
|
return obj == null ? Unit.Empty : (Unit)obj;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
FState["MaxWidth"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 启用自定义的圆角边框
|
/// 启用自定义的圆角边框
|
||||||
@ -776,7 +856,25 @@ namespace FineUI
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Width/Height
|
#region MinHeight/MinHeight
|
||||||
|
|
||||||
|
if (MinHeight != Unit.Empty)
|
||||||
|
{
|
||||||
|
OB.AddProperty("minHeight", MinHeight.Value);
|
||||||
|
}
|
||||||
|
if (MinWidth != Unit.Empty)
|
||||||
|
{
|
||||||
|
OB.AddProperty("minWidth", MinWidth.Value);
|
||||||
|
}
|
||||||
|
if (MaxHeight != Unit.Empty)
|
||||||
|
{
|
||||||
|
OB.AddProperty("maxHeight", MaxHeight.Value);
|
||||||
|
}
|
||||||
|
if (MaxWidth != Unit.Empty)
|
||||||
|
{
|
||||||
|
OB.AddProperty("maxWidth", MaxWidth.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//// 对于Panel,如果宽度/高度没有定义
|
//// 对于Panel,如果宽度/高度没有定义
|
||||||
//if (Width == Unit.Empty && AutoWidth)
|
//if (Width == Unit.Empty && AutoWidth)
|
||||||
|
@ -343,6 +343,26 @@ namespace FineUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 表单中标签的位置
|
||||||
|
/// </summary>
|
||||||
|
[Category(CategoryName.OPTIONS)]
|
||||||
|
[DefaultValue(null)]
|
||||||
|
[Description("表单中标签的位置")]
|
||||||
|
public LabelAlign? LabelAlign
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
object obj = FState["LabelAlign"];
|
||||||
|
return obj == null ? null : (LabelAlign?)obj;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
FState["LabelAlign"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region OnPreRender
|
#region OnPreRender
|
||||||
@ -357,7 +377,7 @@ namespace FineUI
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
if (PropertyModified("Readonly"))
|
if (PropertyModified("Readonly"))
|
||||||
{
|
{
|
||||||
sb.AppendFormat("{0}.setReadOnly({1});", XID, Readonly.ToString().ToLower());
|
sb.AppendFormat("{0}.f_setReadOnly();", XID);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PropertyModified("Label"))
|
if (PropertyModified("Label"))
|
||||||
@ -429,6 +449,11 @@ namespace FineUI
|
|||||||
OB.AddProperty("labelSeparator", LabelSeparator);
|
OB.AddProperty("labelSeparator", LabelSeparator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (LabelAlign != null)
|
||||||
|
{
|
||||||
|
OB.AddProperty("labelAlign", LabelAlignHelper.GetName(LabelAlign.Value));
|
||||||
|
}
|
||||||
|
|
||||||
if (LabelWidth != ConfigPropertyValue.FORM_LABELWIDTH_DEFAULT)
|
if (LabelWidth != ConfigPropertyValue.FORM_LABELWIDTH_DEFAULT)
|
||||||
{
|
{
|
||||||
OB.AddProperty("labelWidth", LabelWidth.Value);
|
OB.AddProperty("labelWidth", LabelWidth.Value);
|
||||||
|
@ -978,7 +978,7 @@ namespace FineUI
|
|||||||
if (currentModifiedProperties.Count > 0)
|
if (currentModifiedProperties.Count > 0)
|
||||||
{
|
{
|
||||||
// 更新当前控件的 F_STATE 状态
|
// 更新当前控件的 F_STATE 状态
|
||||||
sb.AppendFormat("F.state({0},{1});", XID, ConvertPropertiesToJObject(currentModifiedProperties).ToString(Formatting.None));
|
sb.AppendFormat("F.f_state({0},{1});", XID, ConvertPropertiesToJObject(currentModifiedProperties).ToString(Formatting.None));
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.Append(GetHiddenPropertyChangedScript());
|
sb.Append(GetHiddenPropertyChangedScript());
|
||||||
@ -1598,18 +1598,18 @@ namespace FineUI
|
|||||||
|
|
||||||
if (enableAjax != PageManager.Instance.EnableAjax)
|
if (enableAjax != PageManager.Instance.EnableAjax)
|
||||||
{
|
{
|
||||||
sb.AppendFormat("F.control_enable_ajax={0};", enableAjax ? "true" : "false");
|
sb.AppendFormat("F.controlEnableAjax={0};", enableAjax ? "true" : "false");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (EnableAjaxLoading != PageManager.Instance.EnableAjaxLoading)
|
if (EnableAjaxLoading != PageManager.Instance.EnableAjaxLoading)
|
||||||
{
|
{
|
||||||
sb.AppendFormat("F.control_enable_ajax_loading={0};", EnableAjaxLoading ? "true" : "false");
|
sb.AppendFormat("F.controlEnableAjaxLoading={0};", EnableAjaxLoading ? "true" : "false");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AjaxLoadingType != PageManager.Instance.AjaxLoadingType)
|
if (AjaxLoadingType != PageManager.Instance.AjaxLoadingType)
|
||||||
{
|
{
|
||||||
sb.AppendFormat("F.control_ajax_loading_type='{0}';", AjaxLoadingTypeName.GetName(AjaxLoadingType));
|
sb.AppendFormat("F.controlAjaxLoadingType='{0}';", AjaxLoadingTypeName.GetName(AjaxLoadingType));
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.Append(Page.ClientScript.GetPostBackEventReference(this, eventArgument));
|
sb.Append(Page.ClientScript.GetPostBackEventReference(this, eventArgument));
|
||||||
|
@ -81,6 +81,23 @@ namespace FineUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 表单行子项之间的间距
|
||||||
|
/// </summary>
|
||||||
|
[ConfigurationProperty(ConfigPropertyName.FORMROWITEMSSPACE, DefaultValue = ConfigPropertyValue.FORMROW_ITEMSSPACE_DEFAULT)]
|
||||||
|
public int FormRowItemsSpace
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return (int)base[ConfigPropertyName.FORMROWITEMSSPACE];
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
base[ConfigPropertyName.FORMROWITEMSSPACE] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 表单中标签的位置
|
/// 表单中标签的位置
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -119,6 +119,8 @@ namespace FineUI
|
|||||||
public const string ENABLEFSTATECOMPRESS = "EnableFStateCompress";
|
public const string ENABLEFSTATECOMPRESS = "EnableFStateCompress";
|
||||||
public const string IEEDGE = "IEEdge";
|
public const string IEEDGE = "IEEdge";
|
||||||
public const string ENABLEFORMCHANGECONFIRM = "EnableFormChangeConfirm";
|
public const string ENABLEFORMCHANGECONFIRM = "EnableFormChangeConfirm";
|
||||||
|
|
||||||
|
public const string FORMROWITEMSSPACE = "FormRowItemsSpace";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -182,6 +184,9 @@ namespace FineUI
|
|||||||
public const bool ENABLE_FSTATE_COMPRESS = false;
|
public const bool ENABLE_FSTATE_COMPRESS = false;
|
||||||
|
|
||||||
public const bool ENABLE_FORMCHANGECONFIRM_DEFAULT = false;
|
public const bool ENABLE_FORMCHANGECONFIRM_DEFAULT = false;
|
||||||
|
|
||||||
|
public const int FORMROW_ITEMSSPACE_DEFAULT = 8;
|
||||||
|
public const string FORMROW_ITEMSSPACE_DEFAULT_STRING = "8";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -148,6 +148,14 @@ namespace FineUI
|
|||||||
return (MessageTarget)Enum.Parse(typeof(MessageTarget), section.FormMessageTarget, true);
|
return (MessageTarget)Enum.Parse(typeof(MessageTarget), section.FormMessageTarget, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 表单行子项之间的间距
|
||||||
|
/// </summary>
|
||||||
|
public static int GetFormRowItemsSpace()
|
||||||
|
{
|
||||||
|
return section.FormRowItemsSpace;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 表单中标签的位置
|
/// 表单中标签的位置
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -26,6 +26,10 @@ namespace FineUI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
Float,
|
Float,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 双精度浮点数(精度为15~16)
|
||||||
|
/// </summary>
|
||||||
|
Double,
|
||||||
|
/// <summary>
|
||||||
/// 布尔型
|
/// 布尔型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Boolean,
|
Boolean,
|
||||||
@ -61,6 +65,9 @@ namespace FineUI
|
|||||||
case FieldType.Boolean:
|
case FieldType.Boolean:
|
||||||
result = "boolean";
|
result = "boolean";
|
||||||
break;
|
break;
|
||||||
|
case FieldType.Double:
|
||||||
|
result = "double";
|
||||||
|
break;
|
||||||
case FieldType.Date:
|
case FieldType.Date:
|
||||||
result = "date";
|
result = "date";
|
||||||
break;
|
break;
|
||||||
|
@ -53,10 +53,10 @@ namespace FineUI
|
|||||||
/// 手风琴布局(只用于Accordion控件)
|
/// 手风琴布局(只用于Accordion控件)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Accordion,
|
Accordion,
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 表单布局(用于SimpleForm和Form控件)
|
///// 表单布局(用于SimpleForm和Form控件)
|
||||||
/// </summary>
|
///// </summary>
|
||||||
Form,
|
//Form,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 卡片布局(只用于TabStrip控件)
|
/// 卡片布局(只用于TabStrip控件)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -115,9 +115,9 @@ namespace FineUI
|
|||||||
case Layout.Fit:
|
case Layout.Fit:
|
||||||
result = "fit";
|
result = "fit";
|
||||||
break;
|
break;
|
||||||
case Layout.Form:
|
//case Layout.Form:
|
||||||
result = "form";
|
// result = "form";
|
||||||
break;
|
// break;
|
||||||
case Layout.Absolute:
|
case Layout.Absolute:
|
||||||
result = "absolute";
|
result = "absolute";
|
||||||
break;
|
break;
|
||||||
|
@ -97,7 +97,7 @@ namespace FineUI
|
|||||||
|
|
||||||
string themeName = PageManager.Instance.CustomTheme;
|
string themeName = PageManager.Instance.CustomTheme;
|
||||||
|
|
||||||
AddCssPathToHead(page, CONTROL_ID_PREFIX + themeName + ".css", String.Format("{0}/ext-theme-{1}/all.css", page.ResolveUrl(PageManager.Instance.CustomThemeBasePath), themeName));
|
AddCssPathToHead(page, CONTROL_ID_PREFIX + themeName + ".css", String.Format("{0}/ext-theme-{1}/all.css?v{2}", page.ResolveUrl(PageManager.Instance.CustomThemeBasePath), themeName, GlobalConfig.ProductVersion));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -108,7 +108,7 @@ namespace FineUI
|
|||||||
themeName = "classic";
|
themeName = "classic";
|
||||||
}
|
}
|
||||||
|
|
||||||
AddCssPathToHead(page, CONTROL_ID_PREFIX + themeName + ".css", String.Format("{0}/res/ext-theme-{1}/all.css", extjsBasePath, themeName));
|
AddCssPathToHead(page, CONTROL_ID_PREFIX + themeName + ".css", String.Format("{0}/res/ext-theme-{1}/all.css?v{2}", extjsBasePath, themeName, GlobalConfig.ProductVersion));
|
||||||
|
|
||||||
//AddCssPathToHead(page, CONTROL_ID_PREFIX + "ux.css", String.Format("{0}/res/css/ux.css", extjsBasePath));
|
//AddCssPathToHead(page, CONTROL_ID_PREFIX + "ux.css", String.Format("{0}/res/css/ux.css", extjsBasePath));
|
||||||
}
|
}
|
||||||
@ -121,25 +121,25 @@ namespace FineUI
|
|||||||
|
|
||||||
if (GlobalConfig.GetDebugMode())
|
if (GlobalConfig.GetDebugMode())
|
||||||
{
|
{
|
||||||
AddJavascriptPathToPageBottom(page, "ext-part1.js", String.Format("{0}/ext-part1.js", extjsBasePath));
|
AddJavascriptPathToPageBottom(page, "ext-part1.js", String.Format("{0}/ext-part1.js?v{1}", extjsBasePath, GlobalConfig.ProductVersion));
|
||||||
AddJavascriptPathToPageBottom(page, "ext-part2.js", String.Format("{0}/ext-part2.js", extjsBasePath));
|
AddJavascriptPathToPageBottom(page, "ext-part2.js", String.Format("{0}/ext-part2.js?v{1}", extjsBasePath, GlobalConfig.ProductVersion));
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddJavascriptPathToPageBottom(page, "ext-all.js", String.Format("{0}/ext-all.js", extjsBasePath));
|
AddJavascriptPathToPageBottom(page, "ext-all.js", String.Format("{0}/ext-all.js?v{1}", extjsBasePath, GlobalConfig.ProductVersion));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Neptune需要额外的JavaScript文件
|
// Neptune需要额外的JavaScript文件
|
||||||
if (String.IsNullOrEmpty(PageManager.Instance.CustomTheme) && PageManager.Instance.Theme == Theme.Neptune)
|
if (String.IsNullOrEmpty(PageManager.Instance.CustomTheme) && PageManager.Instance.Theme == Theme.Neptune)
|
||||||
{
|
{
|
||||||
AddJavascriptPathToPageBottom(page, "ext-theme-neptune.js", String.Format("{0}/ext-theme-neptune.js", extjsBasePath));
|
AddJavascriptPathToPageBottom(page, "ext-theme-neptune.js", String.Format("{0}/ext-theme-neptune.js?v{1}", extjsBasePath, GlobalConfig.ProductVersion));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 语言资源应该放在最后,其中包含对 X.js 的语言定义
|
// 语言资源应该放在最后,其中包含对 X.js 的语言定义
|
||||||
string langName = LanguageHelper.GetName(PageManager.Instance.Language);
|
string langName = LanguageHelper.GetName(PageManager.Instance.Language);
|
||||||
AddJavascriptPathToPageBottom(page, langName + ".js", String.Format("{0}/lang/{1}.js", extjsBasePath, langName));
|
AddJavascriptPathToPageBottom(page, langName + ".js", String.Format("{0}/lang/{1}.js?v{2}", extjsBasePath, langName, GlobalConfig.ProductVersion));
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
@ -22,38 +22,19 @@ namespace FineUI
|
|||||||
string type = String.Empty;
|
string type = String.Empty;
|
||||||
string typeValue = String.Empty;
|
string typeValue = String.Empty;
|
||||||
string extjsBasePath = GlobalConfig.GetJSBasePath();
|
string extjsBasePath = GlobalConfig.GetJSBasePath();
|
||||||
//resName = "FineUI.";
|
|
||||||
|
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(typeValue = context.Request.QueryString["icon"]))
|
if (!String.IsNullOrEmpty(typeValue = context.Request.QueryString["icon"]))
|
||||||
{
|
{
|
||||||
type = "icon";
|
type = "icon";
|
||||||
}
|
}
|
||||||
//else if (!String.IsNullOrEmpty(typeValue = context.Request.QueryString["js"]))
|
|
||||||
//{
|
|
||||||
// type = "js";
|
|
||||||
// //resName += "js." + typeValue;
|
|
||||||
//}
|
|
||||||
//else if (!String.IsNullOrEmpty(typeValue = context.Request.QueryString["lang"]))
|
|
||||||
//{
|
|
||||||
// type = "lang";
|
|
||||||
// //resName += "js.lang." + typeValue;
|
|
||||||
//}
|
|
||||||
else if (!String.IsNullOrEmpty(typeValue = context.Request.QueryString["theme"]))
|
else if (!String.IsNullOrEmpty(typeValue = context.Request.QueryString["theme"]))
|
||||||
{
|
{
|
||||||
// res.axd?theme=default.grid.refresh.gif
|
|
||||||
type = "theme";
|
type = "theme";
|
||||||
//resName += "res.theme." + typeValue;
|
|
||||||
}
|
}
|
||||||
//else if (!String.IsNullOrEmpty(typeValue = context.Request.QueryString["css"]))
|
|
||||||
//{
|
|
||||||
// type = "css";
|
|
||||||
// //resName += "res.css." + typeValue;
|
|
||||||
//}
|
|
||||||
else if (!String.IsNullOrEmpty(typeValue = context.Request.QueryString["img"]))
|
else if (!String.IsNullOrEmpty(typeValue = context.Request.QueryString["img"]))
|
||||||
{
|
{
|
||||||
type = "img";
|
type = "img";
|
||||||
//resName += "res.img." + typeValue;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -61,7 +42,8 @@ namespace FineUI
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//byte[] binary;
|
string filePath = String.Empty;
|
||||||
|
string fileBasePath = String.Empty;
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case "icon":
|
case "icon":
|
||||||
@ -69,23 +51,9 @@ namespace FineUI
|
|||||||
{
|
{
|
||||||
typeValue = IconHelper.GetName((Icon)Enum.Parse(typeof(Icon), typeValue));
|
typeValue = IconHelper.GetName((Icon)Enum.Parse(typeof(Icon), typeValue));
|
||||||
}
|
}
|
||||||
//resName += "res.icon." + typeValue;
|
fileBasePath = GlobalConfig.GetIconBasePath();
|
||||||
string serverPath = String.Format("{0}/{1}", GlobalConfig.GetIconBasePath(), typeValue);
|
filePath = String.Format("{0}/{1}", fileBasePath, typeValue);
|
||||||
context.Response.WriteFile(context.Server.MapPath(serverPath));
|
|
||||||
|
|
||||||
context.Response.ContentType = "image/" + GetImageFormat(typeValue);
|
|
||||||
break;
|
break;
|
||||||
//case "js":
|
|
||||||
// context.Response.Write(ResourceHelper.GetResourceContent(resName));
|
|
||||||
// context.Response.ContentType = "text/javascript";
|
|
||||||
//case "lang":
|
|
||||||
// context.Response.Write(ResourceHelper.GetResourceContent(resName));
|
|
||||||
// context.Response.ContentType = "text/javascript";
|
|
||||||
// break;
|
|
||||||
//case "css":
|
|
||||||
// context.Response.Write(ResourceHelper.GetResourceContent(resName));
|
|
||||||
// context.Response.ContentType = "text/css";
|
|
||||||
// break;
|
|
||||||
case "theme":
|
case "theme":
|
||||||
string themePath = "";
|
string themePath = "";
|
||||||
string themeImageFormat = "";
|
string themeImageFormat = "";
|
||||||
@ -96,22 +64,39 @@ namespace FineUI
|
|||||||
themeImageFormat = typeValue.Substring(lastDotIndex + 1);
|
themeImageFormat = typeValue.Substring(lastDotIndex + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
context.Response.WriteFile(context.Server.MapPath(String.Format("{0}/res/images/{1}.{2}", extjsBasePath, themePath, themeImageFormat)));
|
fileBasePath = String.Format("{0}/res/images", extjsBasePath);
|
||||||
|
filePath = String.Format("{0}/{1}.{2}", fileBasePath, themePath, themeImageFormat);
|
||||||
context.Response.ContentType = "image/" + GetImageFormat(typeValue);
|
|
||||||
break;
|
break;
|
||||||
case "img":
|
case "img":
|
||||||
//binary = ResourceHelper.GetResourceContentAsBinary(resName);
|
fileBasePath = String.Format("{0}/res/images", extjsBasePath);
|
||||||
//context.Response.OutputStream.Write(binary, 0, binary.Length);
|
filePath = String.Format("{0}/{1}", fileBasePath, typeValue);
|
||||||
//context.Response.ContentType = "image/" + GetImageFormat(resName);
|
|
||||||
|
|
||||||
|
|
||||||
context.Response.WriteFile(context.Server.MapPath(String.Format("{0}/res/images/{1}", extjsBasePath, typeValue)));
|
|
||||||
|
|
||||||
context.Response.ContentType = "image/" + GetImageFormat(typeValue);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string imageType = GetImageFormat(typeValue);
|
||||||
|
string filePathServer = context.Server.MapPath(filePath);
|
||||||
|
|
||||||
|
// 非法图片后缀
|
||||||
|
if (!_allowedImageTypes.Contains(imageType))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 不是根目录下的文件
|
||||||
|
string rootPath = context.Server.MapPath(fileBasePath);
|
||||||
|
if (!filePathServer.StartsWith(rootPath))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 不存在此文件
|
||||||
|
if (!File.Exists(filePathServer))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
context.Response.WriteFile(filePathServer);
|
||||||
|
context.Response.ContentType = "image/" + imageType;
|
||||||
|
|
||||||
// 缓存一年,只能通过改变 URL 来强制更新缓存
|
// 缓存一年,只能通过改变 URL 来强制更新缓存
|
||||||
context.Response.Cache.SetExpires(DateTime.Now.AddYears(1));
|
context.Response.Cache.SetExpires(DateTime.Now.AddYears(1));
|
||||||
@ -136,16 +121,22 @@ namespace FineUI
|
|||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
private string GetImageFormat(string imageName)
|
private string GetImageFormat(string fileName)
|
||||||
{
|
{
|
||||||
int lastDotIndex = imageName.LastIndexOf(".");
|
string imageFormat = String.Empty;
|
||||||
|
|
||||||
|
int lastDotIndex = fileName.LastIndexOf(".");
|
||||||
if (lastDotIndex >= 0)
|
if (lastDotIndex >= 0)
|
||||||
{
|
{
|
||||||
return imageName.Substring(lastDotIndex + 1);
|
imageFormat = fileName.Substring(lastDotIndex + 1);
|
||||||
}
|
}
|
||||||
return "png";
|
return imageFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static readonly List<string> _allowedImageTypes = new List<string> { "bmp", "gif", "jpg", "jpeg", "png", "tiff", "icon" };
|
||||||
|
|
||||||
|
|
||||||
private string GetImageFormat(ImageFormat format)
|
private string GetImageFormat(ImageFormat format)
|
||||||
{
|
{
|
||||||
if (format == ImageFormat.Bmp)
|
if (format == ImageFormat.Bmp)
|
||||||
|
@ -61,8 +61,8 @@ namespace FineUI
|
|||||||
|
|
||||||
public static readonly string PAGE_STATE_CHANGED_ID = "F_CHANGED";
|
public static readonly string PAGE_STATE_CHANGED_ID = "F_CHANGED";
|
||||||
|
|
||||||
// 在FineUI-Utility.js中被使用,不要修改
|
//// 在FineUI-Utility.js中被使用,不要修改
|
||||||
public static readonly string DISABLED_CONTROL_BEFORE_POSTBACK = "F_TARGET";
|
//public static readonly string DISABLED_CONTROL_BEFORE_POSTBACK = "F_TARGET";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -154,8 +154,8 @@ namespace FineUI
|
|||||||
#endregion
|
#endregion
|
||||||
#region 页面上每个控件应该输出的脚本
|
#region 页面上每个控件应该输出的脚本
|
||||||
|
|
||||||
// 设置提交表单的按钮等元素可用enable(有可能在后面的被覆盖)
|
//// 设置提交表单的按钮等元素可用enable(有可能在后面的被覆盖)
|
||||||
sb.Append(GetEnableTargetControlScript());
|
//sb.Append(GetEnableTargetControlScript());
|
||||||
|
|
||||||
// 添加所有需要在AJAX时更新的脚本
|
// 添加所有需要在AJAX时更新的脚本
|
||||||
StringBuilder ajaxScriptBuilder = new StringBuilder();
|
StringBuilder ajaxScriptBuilder = new StringBuilder();
|
||||||
@ -168,6 +168,7 @@ namespace FineUI
|
|||||||
ajaxScriptBuilder.Append(script);
|
ajaxScriptBuilder.Append(script);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
StringBuilder gridTplsBuilder = new StringBuilder();
|
StringBuilder gridTplsBuilder = new StringBuilder();
|
||||||
StringBuilder shortNameBuilder = new StringBuilder();
|
StringBuilder shortNameBuilder = new StringBuilder();
|
||||||
Dictionary<string, string> shortNameDic = ResourceManager.Instance.AjaxShortNameList;
|
Dictionary<string, string> shortNameDic = ResourceManager.Instance.AjaxShortNameList;
|
||||||
@ -215,9 +216,41 @@ namespace FineUI
|
|||||||
gridTplsBuilder.AppendFormat("F('{0}').f_updateTpls({1});", clientId, GetGridTpls(doc, clientId));
|
gridTplsBuilder.AppendFormat("F('{0}').f_updateTpls({1});", clientId, GetGridTpls(doc, clientId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 2. 短名称
|
||||||
|
string shortNameScript = String.Empty;
|
||||||
|
List<string> shortNameList = new List<string>();
|
||||||
|
Dictionary<string, string> shortNameDic = ResourceManager.Instance.AjaxShortNameList;
|
||||||
|
if (shortNameDic.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (string clientId in shortNameDic.Keys)
|
||||||
|
{
|
||||||
|
string xid = shortNameDic[clientId];
|
||||||
|
shortNameList.Add(String.Format("{0}=F('{1}')", xid, clientId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (shortNameList.Count > 0)
|
||||||
|
{
|
||||||
|
shortNameScript = String.Format("var {0};", String.Join(",", shortNameList.ToArray()));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 表格相关
|
||||||
|
StringBuilder gridTplsBuilder = new StringBuilder();
|
||||||
|
|
||||||
|
// 重新加载表格数据(也就是存在对f_loadData函数的调用)
|
||||||
|
if (PageManager.Instance.AjaxGridReloadedClientIDs.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (string reloadGridClientID in PageManager.Instance.AjaxGridReloadedClientIDs)
|
||||||
|
{
|
||||||
|
string xid = shortNameDic[reloadGridClientID];
|
||||||
|
gridTplsBuilder.AppendFormat("{0}.f_tpls={1};", xid, GetGridTpls(doc, reloadGridClientID));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 当前控件
|
// 当前控件
|
||||||
sb.Append(shortNameBuilder.ToString() + gridTplsBuilder.ToString() + ajaxScriptBuilder.ToString());
|
sb.Append(shortNameScript + gridTplsBuilder.ToString() + ajaxScriptBuilder.ToString());
|
||||||
|
|
||||||
|
|
||||||
//// 执行 onReady 脚本
|
//// 执行 onReady 脚本
|
||||||
@ -284,19 +317,19 @@ namespace FineUI
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 设置引起本次回发的按钮(或其他控件)可用
|
///// 设置引起本次回发的按钮(或其他控件)可用
|
||||||
/// </summary>
|
///// </summary>
|
||||||
/// <returns></returns>
|
///// <returns></returns>
|
||||||
private static string GetEnableTargetControlScript()
|
//private static string GetEnableTargetControlScript()
|
||||||
{
|
//{
|
||||||
string targetControlClientID = HttpContext.Current.Request.Form[ResourceManager.DISABLED_CONTROL_BEFORE_POSTBACK];
|
// string targetControlClientID = HttpContext.Current.Request.Form[ResourceManager.DISABLED_CONTROL_BEFORE_POSTBACK];
|
||||||
if (!String.IsNullOrEmpty(targetControlClientID))
|
// if (!String.IsNullOrEmpty(targetControlClientID))
|
||||||
{
|
// {
|
||||||
return String.Format("F.enable('{0}');", targetControlClientID);
|
// return String.Format("F.f_enable('{0}');", targetControlClientID);
|
||||||
}
|
// }
|
||||||
return String.Empty;
|
// return String.Empty;
|
||||||
}
|
//}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -334,7 +367,7 @@ namespace FineUI
|
|||||||
|
|
||||||
if (!String.IsNullOrEmpty(newEventValidation) && (oldEventValidation != newEventValidation))
|
if (!String.IsNullOrEmpty(newEventValidation) && (oldEventValidation != newEventValidation))
|
||||||
{
|
{
|
||||||
sb.Append(String.Format("F.eventValidation('{0}');", newEventValidation));
|
sb.Append(String.Format("F.f_eventValidation('{0}');", newEventValidation));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -390,7 +423,7 @@ namespace FineUI
|
|||||||
// 如果只有很少的一些字符没改变(小于等于150个字符),还是返回完整的ViewState
|
// 如果只有很少的一些字符没改变(小于等于150个字符),还是返回完整的ViewState
|
||||||
if (changeIndex <= 150)
|
if (changeIndex <= 150)
|
||||||
{
|
{
|
||||||
sb.Append(String.Format("if(!F.viewState(__VIEWSTATE,'{0}'))return;", newViewState));
|
sb.Append(String.Format("if(!F.f_viewState(__VIEWSTATE,'{0}'))return;", newViewState));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -400,12 +433,12 @@ namespace FineUI
|
|||||||
changedStr = newViewState.Substring(changeIndex);
|
changedStr = newViewState.Substring(changeIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.Append(String.Format("if(!F.viewState(__VIEWSTATE,'{0}',{1}))return;", changedStr, changeIndex));
|
sb.Append(String.Format("if(!F.f_viewState(__VIEWSTATE,'{0}',{1}))return;", changedStr, changeIndex));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sb.Append("if(!F.viewState(__VIEWSTATE))return;");
|
sb.Append("if(!F.f_viewState(__VIEWSTATE))return;");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,6 +47,11 @@ namespace FineUI
|
|||||||
/// <returns>整型数组</returns>
|
/// <returns>整型数组</returns>
|
||||||
public static int[] IntArrayFromJArray(JArray ja)
|
public static int[] IntArrayFromJArray(JArray ja)
|
||||||
{
|
{
|
||||||
|
if (ja == null || ja.Count == 0)
|
||||||
|
{
|
||||||
|
return new int[0];
|
||||||
|
}
|
||||||
|
|
||||||
int length = ja.Count;
|
int length = ja.Count;
|
||||||
|
|
||||||
int[] array = new int[length];
|
int[] array = new int[length];
|
||||||
@ -64,6 +69,11 @@ namespace FineUI
|
|||||||
/// <returns>字符串数组</returns>
|
/// <returns>字符串数组</returns>
|
||||||
public static string[] StringArrayFromJArray(JArray ja)
|
public static string[] StringArrayFromJArray(JArray ja)
|
||||||
{
|
{
|
||||||
|
if (ja == null || ja.Count == 0)
|
||||||
|
{
|
||||||
|
return new string[0];
|
||||||
|
}
|
||||||
|
|
||||||
int length = ja.Count;
|
int length = ja.Count;
|
||||||
|
|
||||||
string[] array = new string[length];
|
string[] array = new string[length];
|
||||||
@ -81,6 +91,11 @@ namespace FineUI
|
|||||||
/// <returns>对象数组</returns>
|
/// <returns>对象数组</returns>
|
||||||
public static object[] ObjectArrayFromJArray(JArray ja)
|
public static object[] ObjectArrayFromJArray(JArray ja)
|
||||||
{
|
{
|
||||||
|
if (ja == null || ja.Count == 0)
|
||||||
|
{
|
||||||
|
return new object[0];
|
||||||
|
}
|
||||||
|
|
||||||
int length = ja.Count;
|
int length = ja.Count;
|
||||||
|
|
||||||
object[] array = new object[length];
|
object[] array = new object[length];
|
||||||
|
@ -227,11 +227,24 @@ namespace FineUI
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 比较两个整形数组是否相等
|
/// 比较两个整形数组是否相等
|
||||||
|
/// 顺序无关,比如 [1,2] 和 [2,1] 被认为是相同的
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="array1">整形数组1</param>
|
/// <param name="array1">整形数组1</param>
|
||||||
/// <param name="array2">整形数组2</param>
|
/// <param name="array2">整形数组2</param>
|
||||||
/// <returns>是否相等</returns>
|
/// <returns>是否相等</returns>
|
||||||
public static bool CompareIntArray(int[] array1, int[] array2)
|
public static bool CompareIntArray(int[] array1, int[] array2)
|
||||||
|
{
|
||||||
|
return CompareIntArray(array1, array2, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 比较两个整形数组是否相等
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="array1">整形数组1</param>
|
||||||
|
/// <param name="array2">整形数组2</param>
|
||||||
|
/// <param name="keepOrder">是否保持顺序</param>
|
||||||
|
/// <returns>是否相等</returns>
|
||||||
|
public static bool CompareIntArray(int[] array1, int[] array2, bool keepOrder)
|
||||||
{
|
{
|
||||||
if (array1 == null && array2 == null)
|
if (array1 == null && array2 == null)
|
||||||
{
|
{
|
||||||
@ -248,9 +261,31 @@ namespace FineUI
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (keepOrder)
|
||||||
|
{
|
||||||
|
for (int i = 0, count = array1.Length; i < count; i++)
|
||||||
|
{
|
||||||
|
if (array1[i] != array2[i])
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
List<int> list1 = new List<int>(array1);
|
List<int> list1 = new List<int>(array1);
|
||||||
List<int> list2 = new List<int>(array2);
|
List<int> list2 = new List<int>(array2);
|
||||||
|
|
||||||
|
foreach (int item in list1)
|
||||||
|
{
|
||||||
|
if (!list2.Contains(item))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
for (int i = 0; i < list1.Count; i++)
|
for (int i = 0; i < list1.Count; i++)
|
||||||
{
|
{
|
||||||
if (list1[i] != list2[i])
|
if (list1[i] != list2[i])
|
||||||
@ -258,17 +293,31 @@ namespace FineUI
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 比较两个字符串数组是否相等
|
||||||
|
/// 顺序无关,比如 ["value1","value2"] 和 ["value2","value1"] 被认为是相同的
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="array1">字符串数组1</param>
|
||||||
|
/// <param name="array2">字符串数组2</param>
|
||||||
|
/// <returns>是否相等</returns>
|
||||||
|
public static bool CompareStringArray(string[] array1, string[] array2)
|
||||||
|
{
|
||||||
|
return CompareStringArray(array1, array2, false);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 比较两个字符串数组是否相等
|
/// 比较两个字符串数组是否相等
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="array1">字符串数组1</param>
|
/// <param name="array1">字符串数组1</param>
|
||||||
/// <param name="array2">字符串数组2</param>
|
/// <param name="array2">字符串数组2</param>
|
||||||
|
/// <param name="keepOrder">是否保持顺序</param>
|
||||||
/// <returns>是否相等</returns>
|
/// <returns>是否相等</returns>
|
||||||
public static bool CompareStringArray(string[] array1, string[] array2)
|
public static bool CompareStringArray(string[] array1, string[] array2, bool keepOrder)
|
||||||
{
|
{
|
||||||
if (array1 == null && array2 == null)
|
if (array1 == null && array2 == null)
|
||||||
{
|
{
|
||||||
@ -285,9 +334,31 @@ namespace FineUI
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (keepOrder)
|
||||||
|
{
|
||||||
|
for (int i = 0, count = array1.Length; i < count; i++)
|
||||||
|
{
|
||||||
|
if (array1[i] != array2[i])
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
List<string> list1 = new List<string>(array1);
|
List<string> list1 = new List<string>(array1);
|
||||||
List<string> list2 = new List<string>(array2);
|
List<string> list2 = new List<string>(array2);
|
||||||
|
|
||||||
|
foreach (string item in list1)
|
||||||
|
{
|
||||||
|
if (!list2.Contains(item))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
for (int i = 0; i < list1.Count; i++)
|
for (int i = 0; i < list1.Count; i++)
|
||||||
{
|
{
|
||||||
if (list1[i] != list2[i])
|
if (list1[i] != list2[i])
|
||||||
@ -295,6 +366,7 @@ namespace FineUI
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -310,9 +382,27 @@ namespace FineUI
|
|||||||
/// <returns>小数</returns>
|
/// <returns>小数</returns>
|
||||||
public static string ConvertPercentageToDecimalString(string percentageStr)
|
public static string ConvertPercentageToDecimalString(string percentageStr)
|
||||||
{
|
{
|
||||||
|
//string decimalStr = String.Empty;
|
||||||
|
|
||||||
|
//percentageStr = percentageStr.Trim().Replace("%", "%").TrimEnd('%');
|
||||||
|
|
||||||
|
//try
|
||||||
|
//{
|
||||||
|
// decimalStr = (Convert.ToDouble(percentageStr) * 0.01).ToString("F2", System.Globalization.CultureInfo.InvariantCulture);
|
||||||
|
//}
|
||||||
|
//catch
|
||||||
|
//{
|
||||||
|
// ;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//return decimalStr;
|
||||||
|
|
||||||
string decimalStr = String.Empty;
|
string decimalStr = String.Empty;
|
||||||
|
|
||||||
percentageStr = percentageStr.Trim().Replace("%", "%").TrimEnd('%');
|
percentageStr = percentageStr.Trim().ToLower().Replace("%", "%");
|
||||||
|
if (percentageStr.EndsWith("%"))
|
||||||
|
{
|
||||||
|
percentageStr = percentageStr.TrimEnd('%');
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -320,7 +410,16 @@ namespace FineUI
|
|||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
;
|
// nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (percentageStr.EndsWith("px"))
|
||||||
|
{
|
||||||
|
decimalStr = percentageStr.Substring(0, percentageStr.Length - 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
decimalStr = percentageStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return decimalStr;
|
return decimalStr;
|
||||||
|
@ -42,7 +42,7 @@ using System.Web.UI;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("4.2.0.0")]
|
[assembly: AssemblyVersion("4.2.3")]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -101,7 +101,8 @@ namespace FineUI
|
|||||||
/// <returns>客户端脚本</returns>
|
/// <returns>客户端脚本</returns>
|
||||||
public static string GetHideReference()
|
public static string GetHideReference()
|
||||||
{
|
{
|
||||||
return "(function(){var aw=F.wnd.getActiveWindow();if(aw){aw.f_hide();}})();";
|
//return "(function(){var aw=F.wnd.getActiveWindow();if(aw){aw.f_hide();}})();";
|
||||||
|
return "F.activeWnd.hide();";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -112,7 +113,8 @@ namespace FineUI
|
|||||||
{
|
{
|
||||||
//return ACTIVE_WINDOW_SCRIPT + "if(aw){eval('aw[1].X.'+aw[0].id+'_hide_refresh();');}";
|
//return ACTIVE_WINDOW_SCRIPT + "if(aw){eval('aw[1].X.'+aw[0].id+'_hide_refresh();');}";
|
||||||
//return ACTIVE_WINDOW_SCRIPT + "if(aw){aw[0].box_hide_refresh();}";
|
//return ACTIVE_WINDOW_SCRIPT + "if(aw){aw[0].box_hide_refresh();}";
|
||||||
return "(function(){var aw=F.wnd.getActiveWindow();if(aw){aw.f_hide_refresh();}})();";
|
//return "(function(){var aw=F.wnd.getActiveWindow();if(aw){aw.f_hide_refresh();}})();";
|
||||||
|
return "F.activeWnd.hideRefresh();";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -123,7 +125,8 @@ namespace FineUI
|
|||||||
{
|
{
|
||||||
//return ACTIVE_WINDOW_SCRIPT + "if(aw){eval('aw[1].X.'+aw[0].id+'_hide_postback();');}";
|
//return ACTIVE_WINDOW_SCRIPT + "if(aw){eval('aw[1].X.'+aw[0].id+'_hide_postback();');}";
|
||||||
//return ACTIVE_WINDOW_SCRIPT + "if(aw){aw[0].box_hide_postback();}";
|
//return ACTIVE_WINDOW_SCRIPT + "if(aw){aw[0].box_hide_postback();}";
|
||||||
return "(function(){var aw=F.wnd.getActiveWindow();if(aw){aw.f_hide_postback();}})();";
|
//return "(function(){var aw=F.wnd.getActiveWindow();if(aw){aw.f_hide_postback();}})();";
|
||||||
|
return "F.activeWnd.hidePostBack();";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -137,7 +140,8 @@ namespace FineUI
|
|||||||
//return ACTIVE_WINDOW_SCRIPT + "if(aw){aw[0].box_hide_postback('" + argument + "');}";
|
//return ACTIVE_WINDOW_SCRIPT + "if(aw){aw[0].box_hide_postback('" + argument + "');}";
|
||||||
|
|
||||||
//return "(function(){var aw=F.wnd.getActiveWindow(); if(aw){ aw[0].box_hide_postback('" + argument + "'); }})();";
|
//return "(function(){var aw=F.wnd.getActiveWindow(); if(aw){ aw[0].box_hide_postback('" + argument + "'); }})();";
|
||||||
return "(function(){var aw=F.wnd.getActiveWindow();if(aw){aw.f_hide_postback(" + JsHelper.Enquote(argument) + ");}})();";
|
//return "(function(){var aw=F.wnd.getActiveWindow();if(aw){aw.f_hide_postback(" + JsHelper.Enquote(argument) + ");}})();";
|
||||||
|
return "F.activeWnd.hidePostBack(" + JsHelper.Enquote(argument) + ");";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -148,7 +152,8 @@ namespace FineUI
|
|||||||
/// <returns>客户端脚本</returns>
|
/// <returns>客户端脚本</returns>
|
||||||
public static string GetHideExecuteScriptReference(string argument)
|
public static string GetHideExecuteScriptReference(string argument)
|
||||||
{
|
{
|
||||||
return "(function(){var aw=F.wnd.getActiveWindow();if(aw){aw.f_hide_executescript(" + JsHelper.Enquote(argument) + ");}})();";
|
//return "(function(){var aw=F.wnd.getActiveWindow();if(aw){aw.f_hide_executescript(" + JsHelper.Enquote(argument) + ");}})();";
|
||||||
|
return "F.activeWnd.hideExecuteScript(" + JsHelper.Enquote(argument) + ");";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,6 +49,18 @@ namespace FineUI
|
|||||||
|
|
||||||
#region class
|
#region class
|
||||||
|
|
||||||
|
private string _cssClass;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 样式类名
|
||||||
|
/// </summary>
|
||||||
|
public string CssClass
|
||||||
|
{
|
||||||
|
get { return _cssClass; }
|
||||||
|
set { _cssClass = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private string _message;
|
private string _message;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -132,7 +144,8 @@ namespace FineUI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void Show()
|
public void Show()
|
||||||
{
|
{
|
||||||
Show(Message, Title, MessageBoxIcon, OkScript, Target, Icon, IconUrl);
|
//Show(Message, Title, MessageBoxIcon, OkScript, Target, Icon, IconUrl);
|
||||||
|
PageContext.RegisterStartupScript(this.GetShowReference());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -141,7 +154,94 @@ namespace FineUI
|
|||||||
/// <returns>客户端脚本</returns>
|
/// <returns>客户端脚本</returns>
|
||||||
public string GetShowReference()
|
public string GetShowReference()
|
||||||
{
|
{
|
||||||
return GetShowReference(Message, Title, MessageBoxIcon, OkScript, Target, Icon, IconUrl);
|
//return GetShowReference(Message, Title, MessageBoxIcon, OkScript, Target, Icon, IconUrl);
|
||||||
|
|
||||||
|
//if (message == null)
|
||||||
|
//{
|
||||||
|
// message = String.Empty;
|
||||||
|
//}
|
||||||
|
//if (title == null)
|
||||||
|
//{
|
||||||
|
// title = String.Empty;
|
||||||
|
//}
|
||||||
|
|
||||||
|
string message = "";
|
||||||
|
string title = "";
|
||||||
|
if (!String.IsNullOrEmpty(Message))
|
||||||
|
{
|
||||||
|
message = Message;
|
||||||
|
}
|
||||||
|
if (!String.IsNullOrEmpty(Title))
|
||||||
|
{
|
||||||
|
title = Title;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
string addCSSScript = String.Empty;
|
||||||
|
string iconScriptFragment = String.Empty;
|
||||||
|
string resolvedIconUrl = IconHelper.GetResolvedIconUrl(Icon, IconUrl);
|
||||||
|
|
||||||
|
Page page = HttpContext.Current.CurrentHandler as Page;
|
||||||
|
if (page != null)
|
||||||
|
{
|
||||||
|
resolvedIconUrl = page.ResolveUrl(resolvedIconUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
Target target = Target;
|
||||||
|
// Icon 或者 IconUrl 不为空
|
||||||
|
if (!String.IsNullOrEmpty(resolvedIconUrl))
|
||||||
|
{
|
||||||
|
string className = String.Format("f-{0}-alert-icon", System.Guid.NewGuid().ToString("N"));
|
||||||
|
|
||||||
|
var addCSSPrefix = String.Empty;
|
||||||
|
if (target == Target.Parent)
|
||||||
|
{
|
||||||
|
addCSSPrefix = "parent.";
|
||||||
|
}
|
||||||
|
else if (target == Target.Top)
|
||||||
|
{
|
||||||
|
addCSSPrefix = "top.";
|
||||||
|
}
|
||||||
|
addCSSScript = String.Format("{0}F.addCSS('{1}','{2}');", addCSSPrefix, className, StyleUtil.GetNoRepeatBackgroundStyle("." + className, resolvedIconUrl));
|
||||||
|
|
||||||
|
iconScriptFragment = String.Format("'{0}'", className);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
iconScriptFragment = MessageBoxIconHelper.GetName(MessageBoxIcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
message = message.Replace("\r\n", "\n").Replace("\n", "<br/>");
|
||||||
|
title = title.Replace("\r\n", "\n").Replace("\n", "<br/>");
|
||||||
|
string targetScript = "window";
|
||||||
|
if (target != Target.Self)
|
||||||
|
{
|
||||||
|
targetScript = TargetHelper.GetScriptName(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
JsObjectBuilder jsob = new JsObjectBuilder();
|
||||||
|
if (!String.IsNullOrEmpty(CssClass))
|
||||||
|
{
|
||||||
|
jsob.AddProperty("cls", CssClass);
|
||||||
|
}
|
||||||
|
if (!String.IsNullOrEmpty(title))
|
||||||
|
{
|
||||||
|
jsob.AddProperty("title", title);
|
||||||
|
}
|
||||||
|
if (!String.IsNullOrEmpty(OkScript))
|
||||||
|
{
|
||||||
|
jsob.AddProperty("ok", JsHelper.GetFunction(OkScript), true);
|
||||||
|
}
|
||||||
|
if (!String.IsNullOrEmpty(message))
|
||||||
|
{
|
||||||
|
jsob.AddProperty("message", JsHelper.EnquoteWithScriptTag(message), true);
|
||||||
|
}
|
||||||
|
if (!String.IsNullOrEmpty(iconScriptFragment))
|
||||||
|
{
|
||||||
|
jsob.AddProperty("messageIcon", iconScriptFragment, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return addCSSScript + String.Format("{0}.F.alert({1});", targetScript, jsob);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -473,72 +573,34 @@ namespace FineUI
|
|||||||
/// <returns>客户端脚本</returns>
|
/// <returns>客户端脚本</returns>
|
||||||
public static string GetShowReference(string message, string title, MessageBoxIcon messageBoxIcon, string okScript, Target target, Icon icon, string iconUrl)
|
public static string GetShowReference(string message, string title, MessageBoxIcon messageBoxIcon, string okScript, Target target, Icon icon, string iconUrl)
|
||||||
{
|
{
|
||||||
if (message == null)
|
Alert alert = new Alert();
|
||||||
{
|
alert.Message = message;
|
||||||
message = String.Empty;
|
alert.Title = title;
|
||||||
}
|
alert.MessageBoxIcon = messageBoxIcon;
|
||||||
if (title == null)
|
alert.OkScript = okScript;
|
||||||
{
|
alert.Target = target;
|
||||||
title = String.Empty;
|
alert.Icon = icon;
|
||||||
}
|
alert.IconUrl = iconUrl;
|
||||||
|
return alert.GetShowReference();
|
||||||
|
|
||||||
string addCSSScript = String.Empty;
|
|
||||||
string iconScriptFragment = String.Empty;
|
|
||||||
string resolvedIconUrl = IconHelper.GetResolvedIconUrl(icon, iconUrl);
|
|
||||||
|
|
||||||
Page page = HttpContext.Current.CurrentHandler as Page;
|
//if (String.IsNullOrEmpty(title) &&
|
||||||
if (page != null)
|
// messageBoxIcon == DefaultMessageBoxIcon &&
|
||||||
{
|
// String.IsNullOrEmpty(okScript) &&
|
||||||
resolvedIconUrl = page.ResolveUrl(resolvedIconUrl);
|
// String.IsNullOrEmpty(resolvedIconUrl))
|
||||||
}
|
//{
|
||||||
|
// return addCSSScript + String.Format("{0}.F.alert({1});", targetScript, JsHelper.Enquote(message));
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// return addCSSScript + String.Format("{0}.F.alert({1},{2},{3},{4});",
|
||||||
|
// targetScript,
|
||||||
|
// JsHelper.EnquoteWithScriptTag(message),
|
||||||
|
// JsHelper.Enquote(title),
|
||||||
|
// iconScriptFragment,
|
||||||
|
// String.IsNullOrEmpty(okScript) ? "''" : JsHelper.GetFunction(okScript));
|
||||||
|
//}
|
||||||
|
|
||||||
// Icon 或者 IconUrl 不为空
|
|
||||||
if (!String.IsNullOrEmpty(resolvedIconUrl))
|
|
||||||
{
|
|
||||||
string className = String.Format("f-{0}-alert-icon", System.Guid.NewGuid().ToString("N"));
|
|
||||||
|
|
||||||
var addCSSPrefix = String.Empty;
|
|
||||||
if (target == Target.Parent)
|
|
||||||
{
|
|
||||||
addCSSPrefix = "parent.";
|
|
||||||
}
|
|
||||||
else if (target == Target.Top)
|
|
||||||
{
|
|
||||||
addCSSPrefix = "top.";
|
|
||||||
}
|
|
||||||
addCSSScript = String.Format("{0}F.addCSS('{1}','{2}');", addCSSPrefix, className, StyleUtil.GetNoRepeatBackgroundStyle("." + className, resolvedIconUrl));
|
|
||||||
|
|
||||||
iconScriptFragment = String.Format("'{0}'", className);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
iconScriptFragment = MessageBoxIconHelper.GetName(messageBoxIcon);
|
|
||||||
}
|
|
||||||
|
|
||||||
message = message.Replace("\r\n", "\n").Replace("\n", "<br/>");
|
|
||||||
title = title.Replace("\r\n", "\n").Replace("\n", "<br/>");
|
|
||||||
string targetScript = "window";
|
|
||||||
if (target != Target.Self)
|
|
||||||
{
|
|
||||||
targetScript = TargetHelper.GetScriptName(target);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(title) &&
|
|
||||||
messageBoxIcon == DefaultMessageBoxIcon &&
|
|
||||||
String.IsNullOrEmpty(okScript) &&
|
|
||||||
String.IsNullOrEmpty(resolvedIconUrl))
|
|
||||||
{
|
|
||||||
return addCSSScript + String.Format("{0}.F.alert({1});", targetScript, JsHelper.Enquote(message));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return addCSSScript + String.Format("{0}.F.alert({1},{2},{3},{4});",
|
|
||||||
targetScript,
|
|
||||||
JsHelper.EnquoteWithScriptTag(message),
|
|
||||||
JsHelper.Enquote(title),
|
|
||||||
iconScriptFragment,
|
|
||||||
String.IsNullOrEmpty(okScript) ? "''" : JsHelper.GetFunction(okScript));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ namespace FineUI
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 确认对话框帮助类(静态类)
|
/// 确认对话框帮助类(静态类)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class Confirm
|
public class Confirm
|
||||||
{
|
{
|
||||||
#region public static
|
#region public static
|
||||||
|
|
||||||
@ -43,62 +43,447 @@ namespace FineUI
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 确认对话框默认图标
|
/// 确认对话框默认图标
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static MessageBoxIcon DefaultIcon = MessageBoxIcon.Question;
|
public static MessageBoxIcon DefaultMessageBoxIcon = MessageBoxIcon.Question;
|
||||||
|
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 确认对话框默认图标
|
||||||
|
///// </summary>
|
||||||
|
//public static MessageBoxIcon DefaultIcon = MessageBoxIcon.Question;
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Show
|
#region class
|
||||||
|
|
||||||
|
private string _cssClass;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 显示消息框
|
/// 样式类名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message"></param>
|
public string CssClass
|
||||||
|
{
|
||||||
|
get { return _cssClass; }
|
||||||
|
set { _cssClass = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private string _message;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 对话框消息正文
|
||||||
|
/// </summary>
|
||||||
|
public string Message
|
||||||
|
{
|
||||||
|
get { return _message; }
|
||||||
|
set { _message = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _title;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 对话框标题
|
||||||
|
/// </summary>
|
||||||
|
public string Title
|
||||||
|
{
|
||||||
|
get { return _title; }
|
||||||
|
set { _title = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private MessageBoxIcon _messageBoxIcon = DefaultMessageBoxIcon;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 对话框图标
|
||||||
|
/// </summary>
|
||||||
|
public MessageBoxIcon MessageBoxIcon
|
||||||
|
{
|
||||||
|
get { return _messageBoxIcon; }
|
||||||
|
set { _messageBoxIcon = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _okScript;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 点击确认按钮执行的JavaScript脚本
|
||||||
|
/// </summary>
|
||||||
|
public string OkScript
|
||||||
|
{
|
||||||
|
get { return _okScript; }
|
||||||
|
set { _okScript = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private string _cancelScript;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 点击取消按钮执行的JavaScript脚本
|
||||||
|
/// </summary>
|
||||||
|
public string CancelScript
|
||||||
|
{
|
||||||
|
get { return _cancelScript; }
|
||||||
|
set { _cancelScript = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private Target _target;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 对话框的目标位置
|
||||||
|
/// </summary>
|
||||||
|
public Target Target
|
||||||
|
{
|
||||||
|
get { return _target; }
|
||||||
|
set { _target = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
//private string _iconUrl;
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 自定义对话框图标地址
|
||||||
|
///// </summary>
|
||||||
|
//public string IconUrl
|
||||||
|
//{
|
||||||
|
// get { return _iconUrl; }
|
||||||
|
// set { _iconUrl = value; }
|
||||||
|
//}
|
||||||
|
|
||||||
|
//private Icon _icon = Icon.None;
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 自定义对话框图标
|
||||||
|
///// </summary>
|
||||||
|
//public Icon Icon
|
||||||
|
//{
|
||||||
|
// get { return _icon; }
|
||||||
|
// set { _icon = value; }
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 显示对话框
|
||||||
|
/// </summary>
|
||||||
|
public void Show()
|
||||||
|
{
|
||||||
|
//Show(Message, Title, MessageBoxIcon, OkScript, Target, Icon, IconUrl);
|
||||||
|
PageContext.RegisterStartupScript(this.GetShowReference());
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取显示对话框的客户端脚本
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public string GetShowReference()
|
||||||
|
{
|
||||||
|
string message = "";
|
||||||
|
string title = "";
|
||||||
|
if (!String.IsNullOrEmpty(Message))
|
||||||
|
{
|
||||||
|
message = Message;
|
||||||
|
}
|
||||||
|
if (!String.IsNullOrEmpty(Title))
|
||||||
|
{
|
||||||
|
title = Title;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
JsObjectBuilder jsOB = new JsObjectBuilder();
|
||||||
|
|
||||||
|
if (!String.IsNullOrEmpty(CancelScript))
|
||||||
|
{
|
||||||
|
jsOB.AddProperty("cancel", CancelScript);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!String.IsNullOrEmpty(OkScript))
|
||||||
|
{
|
||||||
|
jsOB.AddProperty("ok", OkScript);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Target != Target.Self)
|
||||||
|
{
|
||||||
|
jsOB.AddProperty("target", TargetHelper.GetName(Target));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (MessageBoxIcon != MessageBoxIcon.Warning)
|
||||||
|
{
|
||||||
|
jsOB.AddProperty("messageIcon", MessageBoxIconHelper.GetShortName(MessageBoxIcon));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!String.IsNullOrEmpty(title))
|
||||||
|
{
|
||||||
|
jsOB.AddProperty("title", title.Replace("\r\n", "\n").Replace("\n", "<br/>"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!String.IsNullOrEmpty(message))
|
||||||
|
{
|
||||||
|
jsOB.AddProperty("message", JsHelper.EnquoteWithScriptTag(message.Replace("\r\n", "\n").Replace("\n", "<br/>")), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return String.Format("F.confirm({0});", jsOB.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region static Show
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 显示对话框
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">消息正文</param>
|
||||||
public static void Show(string message)
|
public static void Show(string message)
|
||||||
{
|
{
|
||||||
Show(message, null, DefaultIcon);
|
Show(message, String.Empty, DefaultMessageBoxIcon, String.Empty, String.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 显示消息框
|
/// 显示对话框
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message"></param>
|
/// <param name="message">消息正文</param>
|
||||||
/// <param name="title"></param>
|
/// <param name="title">标题</param>
|
||||||
public static void Show(string message, string title)
|
public static void Show(string message, string title)
|
||||||
{
|
{
|
||||||
Show(message, title, DefaultIcon);
|
Show(message, title, DefaultMessageBoxIcon, String.Empty, String.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 显示消息框
|
/// 显示对话框
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message"></param>
|
/// <param name="message">消息正文</param>
|
||||||
/// <param name="icon"></param>
|
/// <param name="icon">图标</param>
|
||||||
public static void Show(string message, MessageBoxIcon icon)
|
public static void Show(string message, MessageBoxIcon icon)
|
||||||
{
|
{
|
||||||
Show(message, null, icon);
|
Show(message, String.Empty, icon, String.Empty, String.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 显示消息框
|
/// 显示对话框
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message"></param>
|
/// <param name="message">对话框消息</param>
|
||||||
/// <param name="title"></param>
|
/// <param name="title">对话框标题</param>
|
||||||
/// <param name="icon"></param>
|
/// <param name="okScript">点击确定按钮执行的客户端脚本</param>
|
||||||
|
/// <param name="cancelScript">点击取消按钮执行的客户端脚本</param>
|
||||||
|
public static void Show(string message, string title, string okScript, string cancelScript)
|
||||||
|
{
|
||||||
|
Show(message, title, DefaultMessageBoxIcon, okScript, cancelScript);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 显示对话框
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
/// <param name="icon">对话框消息图标</param>
|
||||||
public static void Show(string message, string title, MessageBoxIcon icon)
|
public static void Show(string message, string title, MessageBoxIcon icon)
|
||||||
{
|
{
|
||||||
PageContext.RegisterStartupScript(GetShowReference(message, title, icon));
|
Show(message, title, icon, String.Empty, String.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 显示对话框
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
/// <param name="icon">对话框消息图标</param>
|
||||||
|
/// <param name="okScript">点击确定按钮执行的客户端脚本</param>
|
||||||
|
/// <param name="cancelScript">点击取消按钮执行的客户端脚本</param>
|
||||||
|
public static void Show(string message, string title, MessageBoxIcon icon, string okScript, string cancelScript)
|
||||||
|
{
|
||||||
|
PageContext.RegisterStartupScript(GetShowReference(message, title, icon, okScript, cancelScript));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 显示对话框
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
/// <param name="icon">对话框消息图标</param>
|
||||||
|
/// <param name="okScript">点击确定按钮执行的客户端脚本</param>
|
||||||
|
/// <param name="cancelScript">点击取消按钮执行的客户端脚本</param>
|
||||||
|
/// <param name="target">显示对话框的目标页面</param>
|
||||||
|
public static void Show(string message, string title, MessageBoxIcon icon, string okScript, string cancelScript, Target target)
|
||||||
|
{
|
||||||
|
PageContext.RegisterStartupScript(GetShowReference(message, title, icon, okScript, cancelScript, target));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region static ShowInParent
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 在父页面中显示对话框
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">消息正文</param>
|
||||||
|
public static void ShowInParent(string message)
|
||||||
|
{
|
||||||
|
ShowInParent(message, String.Empty, DefaultMessageBoxIcon, String.Empty, String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 在父页面中显示对话框
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">消息正文</param>
|
||||||
|
/// <param name="title">标题</param>
|
||||||
|
public static void ShowInParent(string message, string title)
|
||||||
|
{
|
||||||
|
ShowInParent(message, title, DefaultMessageBoxIcon, String.Empty, String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 在父页面中显示对话框
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">消息正文</param>
|
||||||
|
/// <param name="icon">图标</param>
|
||||||
|
public static void ShowInParent(string message, MessageBoxIcon icon)
|
||||||
|
{
|
||||||
|
ShowInParent(message, String.Empty, icon, String.Empty, String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 在父页面中显示对话框
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
/// <param name="okScript">点击确定按钮执行的客户端脚本</param>
|
||||||
|
/// <param name="cancelScript">点击取消按钮执行的客户端脚本</param>
|
||||||
|
public static void ShowInParent(string message, string title, string okScript, string cancelScript)
|
||||||
|
{
|
||||||
|
ShowInParent(message, title, DefaultMessageBoxIcon, okScript, cancelScript);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 在父页面中显示对话框
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
/// <param name="icon">对话框消息图标</param>
|
||||||
|
public static void ShowInParent(string message, string title, MessageBoxIcon icon)
|
||||||
|
{
|
||||||
|
ShowInParent(message, title, icon, String.Empty, String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 在父页面中显示对话框
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
/// <param name="icon">对话框消息图标</param>
|
||||||
|
/// <param name="okScript">点击确定按钮执行的客户端脚本</param>
|
||||||
|
/// <param name="cancelScript">点击取消按钮执行的客户端脚本</param>
|
||||||
|
public static void ShowInParent(string message, string title, MessageBoxIcon icon, string okScript, string cancelScript)
|
||||||
|
{
|
||||||
|
PageContext.RegisterStartupScript(GetShowInParentReference(message, title, icon, okScript, cancelScript));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region static ShowInTop
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 在顶层窗口中显示对话框
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">消息正文</param>
|
||||||
|
public static void ShowInTop(string message)
|
||||||
|
{
|
||||||
|
ShowInTop(message, String.Empty, DefaultMessageBoxIcon, String.Empty, String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 在顶层窗口中显示对话框
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">消息正文</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
public static void ShowInTop(string message, string title)
|
||||||
|
{
|
||||||
|
ShowInTop(message, title, DefaultMessageBoxIcon, String.Empty, String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 在顶层窗口中显示对话框
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">消息正文</param>
|
||||||
|
/// <param name="icon">对话框消息图标</param>
|
||||||
|
public static void ShowInTop(string message, MessageBoxIcon icon)
|
||||||
|
{
|
||||||
|
ShowInTop(message, String.Empty, icon, String.Empty, String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 在顶层窗口中显示对话框
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">消息正文</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
/// <param name="okScript">点击确定按钮执行的客户端脚本</param>
|
||||||
|
/// <param name="cancelScript">点击取消按钮执行的客户端脚本</param>
|
||||||
|
public static void ShowInTop(string message, string title, string okScript, string cancelScript)
|
||||||
|
{
|
||||||
|
ShowInTop(message, title, DefaultMessageBoxIcon, okScript, cancelScript);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 在顶层窗口中显示对话框
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">消息正文</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
/// <param name="icon">对话框消息图标</param>
|
||||||
|
public static void ShowInTop(string message, string title, MessageBoxIcon icon)
|
||||||
|
{
|
||||||
|
ShowInTop(message, title, icon, String.Empty, String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 在顶层窗口中显示对话框
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
/// <param name="icon">对话框消息图标</param>
|
||||||
|
/// <param name="okScript">点击确定按钮执行的客户端脚本</param>
|
||||||
|
/// <param name="cancelScript">点击取消按钮执行的客户端脚本</param>
|
||||||
|
public static void ShowInTop(string message, string title, MessageBoxIcon icon, string okScript, string cancelScript)
|
||||||
|
{
|
||||||
|
PageContext.RegisterStartupScript(GetShowInTopReference(message, title, icon, okScript, cancelScript));
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region GetShowReference
|
#region GetShowReference
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取显示确认对话框的客户端脚本
|
/// 获取显示对话框的客户端脚本
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public static string GetShowReference(string message)
|
||||||
|
{
|
||||||
|
return GetShowReference(message, String.Empty, DefaultMessageBoxIcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取显示对话框的客户端脚本
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message">对话框消息</param>
|
/// <param name="message">对话框消息</param>
|
||||||
/// <param name="title">对话框标题</param>
|
/// <param name="title">对话框标题</param>
|
||||||
/// <param name="icon">对话框图标</param>
|
/// <returns>客户端脚本</returns>
|
||||||
|
public static string GetShowReference(string message, string title)
|
||||||
|
{
|
||||||
|
return GetShowReference(message, title, DefaultMessageBoxIcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取显示对话框的客户端脚本
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="icon">对话框消息图标</param>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public static string GetShowReference(string message, MessageBoxIcon icon)
|
||||||
|
{
|
||||||
|
return GetShowReference(message, String.Empty, icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取显示对话框的客户端脚本
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
/// <param name="icon">对话框消息图标</param>
|
||||||
/// <returns>客户端脚本</returns>
|
/// <returns>客户端脚本</returns>
|
||||||
public static string GetShowReference(string message, string title, MessageBoxIcon icon)
|
public static string GetShowReference(string message, string title, MessageBoxIcon icon)
|
||||||
{
|
{
|
||||||
@ -106,17 +491,30 @@ namespace FineUI
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取显示确认对话框的客户端脚本
|
/// 获取显示对话框的客户端脚本
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message">对话框消息</param>
|
/// <param name="message">对话框消息</param>
|
||||||
/// <param name="title">对话框标题</param>
|
/// <param name="title">对话框标题</param>
|
||||||
/// <param name="icon">对话框图标</param>
|
/// <param name="okScript">点击确定按钮执行的客户端脚本</param>
|
||||||
/// <param name="okScriptstring">点击确定按钮执行的客户端脚本</param>
|
|
||||||
/// <param name="cancelScript">点击取消按钮执行的客户端脚本</param>
|
/// <param name="cancelScript">点击取消按钮执行的客户端脚本</param>
|
||||||
/// <returns>客户端脚本</returns>
|
/// <returns>客户端脚本</returns>
|
||||||
public static string GetShowReference(string message, string title, MessageBoxIcon icon, string okScriptstring, string cancelScript)
|
public static string GetShowReference(string message, string title, string okScript, string cancelScript)
|
||||||
{
|
{
|
||||||
return GetShowReference(message, title, icon, okScriptstring, cancelScript, Target.Self);
|
return GetShowReference(message, title, DefaultMessageBoxIcon, okScript, cancelScript);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取显示对话框的客户端脚本
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
/// <param name="icon">对话框消息图标</param>
|
||||||
|
/// <param name="okScript">点击确定按钮执行的客户端脚本</param>
|
||||||
|
/// <param name="cancelScript">点击取消按钮执行的客户端脚本</param>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public static string GetShowReference(string message, string title, MessageBoxIcon icon, string okScript, string cancelScript)
|
||||||
|
{
|
||||||
|
return GetShowReference(message, title, icon, okScript, cancelScript, Target.Self);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -131,6 +529,16 @@ namespace FineUI
|
|||||||
/// <returns>客户端脚本</returns>
|
/// <returns>客户端脚本</returns>
|
||||||
public static string GetShowReference(string message, string title, MessageBoxIcon icon, string okScript, string cancelScript, Target target)
|
public static string GetShowReference(string message, string title, MessageBoxIcon icon, string okScript, string cancelScript, Target target)
|
||||||
{
|
{
|
||||||
|
Confirm confirm = new Confirm();
|
||||||
|
confirm.Message = message;
|
||||||
|
confirm.Title = title;
|
||||||
|
confirm.MessageBoxIcon = icon;
|
||||||
|
confirm.OkScript = okScript;
|
||||||
|
confirm.CancelScript = cancelScript;
|
||||||
|
confirm.Target = target;
|
||||||
|
|
||||||
|
return confirm.GetShowReference();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (String.IsNullOrEmpty(title))
|
if (String.IsNullOrEmpty(title))
|
||||||
{
|
{
|
||||||
@ -157,46 +565,217 @@ namespace FineUI
|
|||||||
}
|
}
|
||||||
return String.Format("{0}.Ext.MessageBox.show({1});", targetName, ob.ToString());
|
return String.Format("{0}.Ext.MessageBox.show({1});", targetName, ob.ToString());
|
||||||
*/
|
*/
|
||||||
string scriptTitle = "''";
|
//string scriptTitle = "''";
|
||||||
if (!String.IsNullOrEmpty(title))
|
//if (!String.IsNullOrEmpty(title))
|
||||||
{
|
//{
|
||||||
scriptTitle = JsHelper.Enquote(title.Replace("\r\n", "\n").Replace("\n", "<br/>"));
|
// scriptTitle = JsHelper.Enquote(title.Replace("\r\n", "\n").Replace("\n", "<br/>"));
|
||||||
}
|
//}
|
||||||
string scriptMessage = JsHelper.EnquoteWithScriptTag(message.Replace("\r\n", "\n").Replace("\n", "<br/>"));
|
//string scriptMessage = JsHelper.EnquoteWithScriptTag(message.Replace("\r\n", "\n").Replace("\n", "<br/>"));
|
||||||
|
|
||||||
string scriptIconName = "''";
|
//string scriptIconName = "''";
|
||||||
if (icon != MessageBoxIcon.Warning)
|
//if (icon != MessageBoxIcon.Warning)
|
||||||
{
|
//{
|
||||||
scriptIconName = String.Format("'{0}'", MessageBoxIconHelper.GetShortName(icon));
|
// scriptIconName = String.Format("'{0}'", MessageBoxIconHelper.GetShortName(icon));
|
||||||
}
|
//}
|
||||||
|
|
||||||
string scriptTargetName = "''";
|
//string scriptTargetName = "''";
|
||||||
if (target != Target.Self)
|
//if (target != Target.Self)
|
||||||
{
|
//{
|
||||||
scriptTargetName = String.Format("'{0}'", TargetHelper.GetName(target));
|
// scriptTargetName = String.Format("'{0}'", TargetHelper.GetName(target));
|
||||||
}
|
//}
|
||||||
string scriptCancel = JsHelper.Enquote(cancelScript);
|
//string scriptCancel = JsHelper.Enquote(cancelScript);
|
||||||
string scriptOK = JsHelper.Enquote(okScript);
|
//string scriptOK = JsHelper.Enquote(okScript);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//JsObjectBuilder jsOB = new JsObjectBuilder();
|
||||||
|
|
||||||
|
//if (!String.IsNullOrEmpty(cancelScript))
|
||||||
|
//{
|
||||||
|
// jsOB.AddProperty("cancel", cancelScript);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (!String.IsNullOrEmpty(okScript))
|
||||||
|
//{
|
||||||
|
// jsOB.AddProperty("ok", okScript);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (target != Target.Self)
|
||||||
|
//{
|
||||||
|
// jsOB.AddProperty("target", TargetHelper.GetName(target));
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (icon != MessageBoxIcon.Warning)
|
||||||
|
//{
|
||||||
|
// jsOB.AddProperty("messageIcon", MessageBoxIconHelper.GetShortName(icon));
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (!String.IsNullOrEmpty(title))
|
||||||
|
//{
|
||||||
|
// jsOB.AddProperty("title", title.Replace("\r\n", "\n").Replace("\n", "<br/>"));
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (!String.IsNullOrEmpty(message))
|
||||||
|
//{
|
||||||
|
// jsOB.AddProperty("message", JsHelper.EnquoteWithScriptTag(message.Replace("\r\n", "\n").Replace("\n", "<br/>")), true);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//return String.Format("F.confirm({0});", jsOB.ToString());
|
||||||
|
|
||||||
if (scriptIconName == "''")
|
|
||||||
{
|
|
||||||
if (scriptCancel == "''")
|
|
||||||
{
|
|
||||||
return String.Format("F.confirm({0},{1},{2},{3});", scriptTargetName, scriptTitle, scriptMessage, scriptOK);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return String.Format("F.confirm({0},{1},{2},{3},{4});", scriptTargetName, scriptTitle, scriptMessage, scriptOK, scriptCancel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return String.Format("F.confirm({0},{1},{2},{3},{4},{5});", scriptTargetName, scriptTitle, scriptMessage, scriptOK, scriptCancel, scriptIconName);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region static GetShowInParentReference
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取在父页面中显示对话框的客户端脚本
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public static string GetShowInParentReference(string message)
|
||||||
|
{
|
||||||
|
return GetShowInParentReference(message, String.Empty, DefaultMessageBoxIcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取在父页面中显示对话框的客户端脚本
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public static string GetShowInParentReference(string message, string title)
|
||||||
|
{
|
||||||
|
return GetShowInParentReference(message, title, DefaultMessageBoxIcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取在父页面中显示对话框的客户端脚本
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="icon">对话框消息图标</param>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public static string GetShowInParentReference(string message, MessageBoxIcon icon)
|
||||||
|
{
|
||||||
|
return GetShowInParentReference(message, String.Empty, icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取在父页面中显示对话框的客户端脚本
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
/// <param name="icon">对话框消息图标</param>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public static string GetShowInParentReference(string message, string title, MessageBoxIcon icon)
|
||||||
|
{
|
||||||
|
return GetShowInParentReference(message, title, icon, String.Empty, String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取在父页面中显示对话框的客户端脚本
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
/// <param name="okScript">点击确定按钮执行的客户端脚本</param>
|
||||||
|
/// <param name="cancelScript">点击取消按钮执行的客户端脚本</param>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public static string GetShowInParentReference(string message, string title, string okScript, string cancelScript)
|
||||||
|
{
|
||||||
|
return GetShowInParentReference(message, title, DefaultMessageBoxIcon, okScript, cancelScript);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取在父页面中显示对话框的客户端脚本
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
/// <param name="icon">对话框消息图标</param>
|
||||||
|
/// <param name="okScript">点击确定按钮执行的客户端脚本</param>
|
||||||
|
/// <param name="cancelScript">点击取消按钮执行的客户端脚本</param>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public static string GetShowInParentReference(string message, string title, MessageBoxIcon icon, string okScript, string cancelScript)
|
||||||
|
{
|
||||||
|
return GetShowReference(message, title, icon, okScript, cancelScript, Target.Parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region static GetShowInTopReference
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取在最上层页面中显示对话框的客户端脚本
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public static string GetShowInTopReference(string message)
|
||||||
|
{
|
||||||
|
return GetShowInTopReference(message, String.Empty, DefaultMessageBoxIcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取在最上层页面中显示对话框的客户端脚本
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public static string GetShowInTopReference(string message, string title)
|
||||||
|
{
|
||||||
|
return GetShowInTopReference(message, title, DefaultMessageBoxIcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取在最上层页面中显示对话框的客户端脚本
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="icon">对话框消息图标</param>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public static string GetShowInTopReference(string message, MessageBoxIcon icon)
|
||||||
|
{
|
||||||
|
return GetShowInTopReference(message, String.Empty, icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取在最上层页面中显示对话框的客户端脚本
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
/// <param name="icon">对话框消息图标</param>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public static string GetShowInTopReference(string message, string title, MessageBoxIcon icon)
|
||||||
|
{
|
||||||
|
return GetShowInTopReference(message, title, icon, String.Empty, String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取在最上层页面中显示对话框的客户端脚本
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
/// <param name="okScript">点击确定按钮执行的客户端脚本</param>
|
||||||
|
/// <param name="cancelScript">点击取消按钮执行的客户端脚本</param>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public static string GetShowInTopReference(string message, string title, string okScript, string cancelScript)
|
||||||
|
{
|
||||||
|
return GetShowInTopReference(message, title, DefaultMessageBoxIcon, okScript, cancelScript);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取在最上层页面中显示对话框的客户端脚本
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">对话框消息</param>
|
||||||
|
/// <param name="title">对话框标题</param>
|
||||||
|
/// <param name="icon">对话框消息图标</param>
|
||||||
|
/// <param name="okScript">点击确定按钮执行的客户端脚本</param>
|
||||||
|
/// <param name="cancelScript">点击取消按钮执行的客户端脚本</param>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public static string GetShowInTopReference(string message, string title, MessageBoxIcon icon, string okScript, string cancelScript)
|
||||||
|
{
|
||||||
|
return GetShowReference(message, title, icon, okScript, cancelScript, Target.Top);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ namespace FineUI
|
|||||||
[ParseChildren(true)]
|
[ParseChildren(true)]
|
||||||
[PersistChildren(false)]
|
[PersistChildren(false)]
|
||||||
[ControlBuilder(typeof(NotAllowWhitespaceLiteralsBuilder))]
|
[ControlBuilder(typeof(NotAllowWhitespaceLiteralsBuilder))]
|
||||||
public class Button : Component, IPostBackEventHandler, IPostBackDataHandler
|
public class Button : BoxComponent, IPostBackEventHandler, IPostBackDataHandler
|
||||||
{
|
{
|
||||||
#region Constructor
|
#region Constructor
|
||||||
|
|
||||||
@ -826,7 +826,7 @@ namespace FineUI
|
|||||||
{
|
{
|
||||||
if (!String.IsNullOrEmpty(disableControlJavascriptID))
|
if (!String.IsNullOrEmpty(disableControlJavascriptID))
|
||||||
{
|
{
|
||||||
postBackScript += String.Format("F.disable('{0}');", disableControlJavascriptID);
|
postBackScript += String.Format("F.f_disable('{0}');", disableControlJavascriptID);
|
||||||
}
|
}
|
||||||
postBackScript += postBackEventReference;
|
postBackScript += postBackEventReference;
|
||||||
}
|
}
|
||||||
|
@ -361,31 +361,28 @@ namespace FineUI
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private List<string> _ajaxGridClientIDs = new List<string>();
|
//private List<string> _ajaxGridClientIDs = new List<string>();
|
||||||
|
///// <summary>
|
||||||
/// <summary>
|
///// 本次AJAX请求过程中需要更新TemplateField的表格
|
||||||
/// 本次AJAX请求过程中需要更新TemplateField的表格
|
///// </summary>
|
||||||
/// </summary>
|
//internal List<string> AjaxGridClientIDs
|
||||||
internal List<string> AjaxGridClientIDs
|
//{
|
||||||
{
|
// get
|
||||||
get
|
// {
|
||||||
{
|
// return _ajaxGridClientIDs;
|
||||||
return _ajaxGridClientIDs;
|
// }
|
||||||
}
|
// set
|
||||||
set
|
// {
|
||||||
{
|
// _ajaxGridClientIDs = value;
|
||||||
_ajaxGridClientIDs = value;
|
// }
|
||||||
}
|
//}
|
||||||
}
|
//internal void AddAjaxGridClientID(string clientID)
|
||||||
|
//{
|
||||||
|
// if (!_ajaxGridClientIDs.Contains(clientID))
|
||||||
internal void AddAjaxGridClientID(string clientID)
|
// {
|
||||||
{
|
// _ajaxGridClientIDs.Add(clientID);
|
||||||
if (!_ajaxGridClientIDs.Contains(clientID))
|
// }
|
||||||
{
|
//}
|
||||||
_ajaxGridClientIDs.Add(clientID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<string> _ajaxGridReloadedClientIDs = new List<string>();
|
private List<string> _ajaxGridReloadedClientIDs = new List<string>();
|
||||||
|
|
||||||
@ -886,6 +883,37 @@ namespace FineUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 表单行子项之间的间距
|
||||||
|
/// </summary>
|
||||||
|
[Category(CategoryName.OPTIONS)]
|
||||||
|
[DefaultValue(typeof(Unit), ConfigPropertyValue.FORMROW_ITEMSSPACE_DEFAULT_STRING)]
|
||||||
|
[Description("表单行子项之间的间距")]
|
||||||
|
public Unit FormRowItemsSpace
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
object obj = FState["FormRowItemsSpace"];
|
||||||
|
if (obj == null)
|
||||||
|
{
|
||||||
|
if (DesignMode)
|
||||||
|
{
|
||||||
|
return (Unit)ConfigPropertyValue.FORMROW_ITEMSSPACE_DEFAULT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return (Unit)GlobalConfig.GetFormRowItemsSpace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (Unit)obj;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
FState["FormRowItemsSpace"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 表单中标签的位置
|
/// 表单中标签的位置
|
||||||
@ -1220,7 +1248,7 @@ namespace FineUI
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string createScript = String.Format("F.pagemanager={1};", XID, job);
|
string createScript = String.Format("F.f_pagemanager={1};", XID, job);
|
||||||
AddStartupScript(createScript);
|
AddStartupScript(createScript);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1339,7 +1367,7 @@ namespace FineUI
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region GetIFramePostBackEventReference
|
#region GetCustomEventReference
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取回发的客户端脚本(触发PageManager的CustomEvent事件)
|
/// 获取回发的客户端脚本(触发PageManager的CustomEvent事件)
|
||||||
@ -1351,6 +1379,17 @@ namespace FineUI
|
|||||||
return GetCustomEventReference(eventArgument, false);
|
return GetCustomEventReference(eventArgument, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取回发的客户端脚本(触发PageManager的CustomEvent事件)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="enableAjax">当前请求是否启用AJAX</param>
|
||||||
|
/// <param name="eventArgument">事件参数</param>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public string GetCustomEventReference(bool enableAjax, string eventArgument)
|
||||||
|
{
|
||||||
|
return GetCustomEventReference(enableAjax, eventArgument, false);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取回发的客户端脚本(触发PageManager的CustomEvent事件)
|
/// 获取回发的客户端脚本(触发PageManager的CustomEvent事件)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -1359,7 +1398,54 @@ namespace FineUI
|
|||||||
/// <returns>客户端脚本</returns>
|
/// <returns>客户端脚本</returns>
|
||||||
public string GetCustomEventReference(string eventArgument, bool validateForms)
|
public string GetCustomEventReference(string eventArgument, bool validateForms)
|
||||||
{
|
{
|
||||||
return String.Format("F.customEvent({0}, {1});", JsHelper.Enquote(eventArgument), validateForms.ToString().ToLower());
|
return GetCustomEventReference(eventArgument, validateForms, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取回发的客户端脚本(触发PageManager的CustomEvent事件)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="enableAjax">当前请求是否启用AJAX</param>
|
||||||
|
/// <param name="eventArgument">事件参数</param>
|
||||||
|
/// <param name="validateForms">是否在回发前验证表单(在PageManager上进行表单配置)</param>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public string GetCustomEventReference(bool enableAjax, string eventArgument, bool validateForms)
|
||||||
|
{
|
||||||
|
return GetCustomEventReference(enableAjax, eventArgument, validateForms, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取回发的客户端脚本(触发PageManager的CustomEvent事件)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="eventArgument">事件参数</param>
|
||||||
|
/// <param name="validateForms">是否在回发前验证表单(在PageManager上进行表单配置)</param>
|
||||||
|
/// <param name="persistOriginal">保持eventArgument参数原样输出</param>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public string GetCustomEventReference(string eventArgument, bool validateForms, bool persistOriginal)
|
||||||
|
{
|
||||||
|
string arg = eventArgument;
|
||||||
|
if (!persistOriginal)
|
||||||
|
{
|
||||||
|
arg = JsHelper.Enquote(arg);
|
||||||
|
}
|
||||||
|
return String.Format("F.f_customEvent({0},{1});", arg, validateForms.ToString().ToLower());
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取回发的客户端脚本(触发PageManager的CustomEvent事件)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="enableAjax">当前请求是否启用AJAX</param>
|
||||||
|
/// <param name="eventArgument">事件参数</param>
|
||||||
|
/// <param name="validateForms">是否在回发前验证表单(在PageManager上进行表单配置)</param>
|
||||||
|
/// <param name="persistOriginal">保持eventArgument参数原样输出</param>
|
||||||
|
/// <returns>客户端脚本</returns>
|
||||||
|
public string GetCustomEventReference(bool enableAjax, string eventArgument, bool validateForms, bool persistOriginal)
|
||||||
|
{
|
||||||
|
string arg = eventArgument;
|
||||||
|
if (!persistOriginal)
|
||||||
|
{
|
||||||
|
arg = JsHelper.Enquote(arg);
|
||||||
|
}
|
||||||
|
return String.Format("F.f_customEvent({0},{1},{2});", enableAjax.ToString().ToLower(), arg, validateForms.ToString().ToLower());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -291,7 +291,7 @@ namespace FineUI
|
|||||||
base.OnFirstPreRender();
|
base.OnFirstPreRender();
|
||||||
|
|
||||||
|
|
||||||
AddStartupAbsoluteScript("F.form_upload_file=true;");
|
//AddStartupAbsoluteScript("F.form_upload_file=true;");
|
||||||
|
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(ButtonText))
|
if (!String.IsNullOrEmpty(ButtonText))
|
||||||
|
@ -119,6 +119,40 @@ namespace FineUI
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region FormRowItemsSpace
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 表单行子项之间的间距
|
||||||
|
/// </summary>
|
||||||
|
[Category(CategoryName.LAYOUT)]
|
||||||
|
[DefaultValue(typeof(Unit), ConfigPropertyValue.FORMROW_ITEMSSPACE_DEFAULT_STRING)]
|
||||||
|
[Description("表单行子项之间的间距")]
|
||||||
|
public Unit FormRowItemsSpace
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
object obj = FState["FormRowItemsSpace"];
|
||||||
|
if (obj == null)
|
||||||
|
{
|
||||||
|
if (DesignMode)
|
||||||
|
{
|
||||||
|
return ConfigPropertyValue.FORMROW_ITEMSSPACE_DEFAULT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PageManager.Instance.FormRowItemsSpace;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (Unit)obj;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
FState["FormRowItemsSpace"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Rows
|
#region Rows
|
||||||
|
|
||||||
private FormRowCollection _rows;
|
private FormRowCollection _rows;
|
||||||
@ -180,405 +214,412 @@ namespace FineUI
|
|||||||
|
|
||||||
#region ResolveRows
|
#region ResolveRows
|
||||||
|
|
||||||
// 包含行的列脚本
|
//// 包含行的列脚本
|
||||||
string rowScriptStr = String.Empty;
|
//string rowScriptStr = String.Empty;
|
||||||
// 行的集合
|
//// 行的集合
|
||||||
string rowItemScriptStr = String.Empty;
|
//string rowItemScriptStr = String.Empty;
|
||||||
|
|
||||||
// 如果存在Rows集合
|
//// 如果存在Rows集合
|
||||||
if (Rows.Count > 0)
|
//if (Rows.Count > 0)
|
||||||
{
|
//{
|
||||||
// rowScriptStr
|
// // rowScriptStr
|
||||||
// rowItemScriptStr: [X.__Panel1_UpdatePanelConnector1_Panel7_Form5_row0,X.__Panel1_UpdatePanelConnector1_Panel7_Form5_row2]
|
// // rowItemScriptStr: [X.__Panel1_UpdatePanelConnector1_Panel7_Form5_row0,X.__Panel1_UpdatePanelConnector1_Panel7_Form5_row2]
|
||||||
ResolveRows(ref rowScriptStr, ref rowItemScriptStr);
|
// ResolveRows(ref rowScriptStr, ref rowItemScriptStr);
|
||||||
|
|
||||||
// 添加Items
|
// // 添加Items
|
||||||
OB.RemoveProperty("items");
|
// OB.RemoveProperty("items");
|
||||||
OB.AddProperty("items", rowItemScriptStr, true);
|
// OB.AddProperty("items", rowItemScriptStr, true);
|
||||||
}
|
//}
|
||||||
|
|
||||||
//rowScriptStr += "\r\n";
|
////rowScriptStr += "\r\n";
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
//OptionBuilder defaultsOB = new OptionBuilder();
|
#region Rows
|
||||||
//defaultsOB.Listeners.AddProperty("change", JsHelper.GetFunction("F.util.setPageStateChanged();"), true);
|
|
||||||
//OB.AddProperty("defaults", defaultsOB);
|
if (Rows.Count > 0)
|
||||||
|
{
|
||||||
|
JsArrayBuilder ab = new JsArrayBuilder();
|
||||||
|
foreach (FormRow row in Rows)
|
||||||
|
{
|
||||||
|
if (row.Visible)
|
||||||
|
{
|
||||||
|
ab.AddProperty(String.Format("{0}", row.XID), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
OB.AddProperty("items", ab.ToString(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
//OB.Listeners.AddProperty("change", JsHelper.GetFunction("F.util.setPageStateChanged();"), true);
|
|
||||||
//OB.Listeners.AddProperty("dirtychange", JsHelper.GetFunction("F.util.setPageStateChanged(dirty);", "form", "dirty"), true);
|
|
||||||
AddListener("dirtychange", "F.util.setPageStateChanged(dirty);", "form", "dirty");
|
AddListener("dirtychange", "F.util.setPageStateChanged(dirty);", "form", "dirty");
|
||||||
//if (!String.IsNullOrEmpty(SubmitButton))
|
|
||||||
//{
|
|
||||||
// Control control = ControlUtil.FindControl(SubmitButton);
|
|
||||||
// if (control != null && control is ControlBase)
|
|
||||||
// {
|
|
||||||
// OB.Listeners.AddProperty("render", JsHelper.GetFunction("F.util.formEnterKey(form,'" + control.ClientID + "');", "form"), true);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
string formPanelScript = String.Format("var {0}=Ext.create('Ext.form.Panel',{1});", XID, OB.ToString());
|
string formPanelScript = String.Format("var {0}=Ext.create('Ext.form.Panel',{1});", XID, OB.ToString());
|
||||||
//AddStartupScript(this, rowScriptStr + formPanelScript);
|
|
||||||
|
|
||||||
string jsContent = rowScriptStr + formPanelScript;
|
//string jsContent = rowScriptStr + formPanelScript;
|
||||||
AddStartupScript(jsContent);
|
AddStartupScript(formPanelScript);
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 处理列
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
private void ResolveRows(ref string rowScriptsStr, ref string rowIdsStr)
|
|
||||||
{
|
|
||||||
JsArrayBuilder rowIdsBuilder = new JsArrayBuilder();
|
|
||||||
|
|
||||||
// 上一行的列数
|
|
||||||
int lastRowColumnCount = 1;
|
|
||||||
// 上一行的列数
|
|
||||||
string lastRowColumnWidths = String.Empty;
|
|
||||||
// 是否已经开始多列
|
|
||||||
bool isMultiColumnStarted = false;
|
|
||||||
// 多列的开始行的序号
|
|
||||||
int multiColumnStartLineIndex = 0;
|
|
||||||
|
|
||||||
for (int i = 0, rowCount = Rows.Count; i < rowCount; i++)
|
|
||||||
{
|
|
||||||
FormRow currentRow = Rows[i];
|
|
||||||
int currentRowColumnCount = GetRowColumnCount(currentRow);
|
|
||||||
string currentRowColumnWidths = currentRow.ColumnWidths;
|
|
||||||
|
|
||||||
if (currentRowColumnCount == 0)
|
|
||||||
{
|
|
||||||
// 如果当前行为空,则跳过此行
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else if (currentRowColumnCount == 1)
|
|
||||||
{
|
|
||||||
if (isMultiColumnStarted)
|
|
||||||
{
|
|
||||||
// 如果上一行是多列行,则添加本行之上的所有行
|
|
||||||
rowScriptsStr += AddColumnScript(rowIdsBuilder, multiColumnStartLineIndex, i - 1, lastRowColumnCount);
|
|
||||||
//rowScriptsStr += "\r\n";
|
|
||||||
|
|
||||||
// 开始重置记录本行为多列的开始
|
|
||||||
isMultiColumnStarted = false;
|
|
||||||
multiColumnStartLineIndex = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果当前行的列数为1,则直接添加Field元素
|
|
||||||
//AddItemScript(ab, currentRow.Fields[0].ClientID);
|
|
||||||
ControlBase component = GetRowColumnControl(currentRow, 0);
|
|
||||||
if (component != null)
|
|
||||||
{
|
|
||||||
rowIdsBuilder.AddProperty(String.Format("{0}", component.XID), true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// 如果本行是多列
|
|
||||||
if (!isMultiColumnStarted)
|
|
||||||
{
|
|
||||||
// 如果上一行还是单列的话,则开始多列
|
|
||||||
isMultiColumnStarted = true;
|
|
||||||
multiColumnStartLineIndex = i;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (lastRowColumnCount == currentRowColumnCount && lastRowColumnWidths == currentRowColumnWidths)
|
|
||||||
{
|
|
||||||
// 如果上一行的列数和本行的列数相同(并且上一行每列的宽度和本行的每列宽度也一样),则继续下一行
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// 如果上一行的列数和本行的列数不相同,则添加本行之上的所有行
|
|
||||||
rowScriptsStr += AddColumnScript(rowIdsBuilder, multiColumnStartLineIndex, i - 1, lastRowColumnCount);
|
|
||||||
//rowScriptsStr += "\r\n";
|
|
||||||
|
|
||||||
// 开始重新记录本行为多列的开始
|
|
||||||
isMultiColumnStarted = true;
|
|
||||||
multiColumnStartLineIndex = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
lastRowColumnCount = currentRowColumnCount;
|
|
||||||
lastRowColumnWidths = currentRowColumnWidths;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 还要判断一下(如果最后一行是两列的情况)
|
|
||||||
if (isMultiColumnStarted)
|
|
||||||
{
|
|
||||||
rowScriptsStr += AddColumnScript(rowIdsBuilder, multiColumnStartLineIndex, Rows.Count - 1, lastRowColumnCount);
|
|
||||||
//rowScriptsStr += "\r\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
rowIdsStr = rowIdsBuilder.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 添加列
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="rowIdsBuilder">行ID集合</param>
|
|
||||||
/// <param name="startLineIndex">开始行的索引(包含)</param>
|
|
||||||
/// <param name="endLineIndex">结束行的索引(包含)</param>
|
|
||||||
/// <param name="columnCount">行的列数</param>
|
|
||||||
private string AddColumnScript(JsArrayBuilder rowIdsBuilder, int startLineIndex, int endLineIndex, int columnCount)
|
|
||||||
{
|
|
||||||
// 注意,注册脚本的控件应该是最后一个 Row
|
|
||||||
// 假如有从上之下这些控件: Row1(Field1,Field2), Row2(Field3,Field4),Row3(Field5)
|
|
||||||
// 则渲染时,JS脚本的执行顺序为:Field1,Field2,Row1,Field3,Field4,Row2,Field5,Row3
|
|
||||||
// 所以,如果column Panel的脚本注册为控件 Row3,则能保证所有的子控件已经初始化
|
|
||||||
// 需要注意的是:在此设置脚本内容到 Row3 控件
|
|
||||||
// 现在已经不是这样的了!!!,Row不在是一个控件
|
|
||||||
|
|
||||||
#region examples
|
|
||||||
|
|
||||||
|
|
||||||
// {
|
|
||||||
// layout: 'column',
|
|
||||||
// border:false,
|
|
||||||
// items:[{
|
|
||||||
// columnWidth: .5,
|
|
||||||
// layout: 'form',
|
|
||||||
// border:false,
|
|
||||||
// items:[{
|
|
||||||
// xtype:'combo',
|
|
||||||
// store: nextStepStore,
|
|
||||||
// displayField:'text',
|
|
||||||
// valueField:'value',
|
|
||||||
// typeAhead: true,
|
|
||||||
// mode: 'local',
|
|
||||||
// triggerAction: 'all',
|
|
||||||
// value:'1',
|
|
||||||
// emptyText:'请选择下一步',
|
|
||||||
// selectOnFocus:true,
|
|
||||||
// allowBlank:false,
|
|
||||||
// fieldLabel: '下一步',
|
|
||||||
// labelSeparator:' <span style="color:red;vertical-align:text-bottom;">*</span>',
|
|
||||||
// name: 'nextStep',
|
|
||||||
// anchor:'95%'
|
|
||||||
// }]
|
|
||||||
// },{
|
|
||||||
// columnWidth: .5,
|
|
||||||
// layout: 'form',
|
|
||||||
// border:false,
|
|
||||||
// items:[{
|
|
||||||
// xtype:'combo',
|
|
||||||
// store: executePersonStore,
|
|
||||||
// displayField:'text',
|
|
||||||
// valueField:'value',
|
|
||||||
// typeAhead: true,
|
|
||||||
// mode: 'local',
|
|
||||||
// triggerAction: 'all',
|
|
||||||
// value:'1',
|
|
||||||
// emptyText:'请选择执行人',
|
|
||||||
// selectOnFocus:true,
|
|
||||||
// allowBlank:false,
|
|
||||||
// fieldLabel: '执行人',
|
|
||||||
// labelSeparator:' <span style="color:red;vertical-align:text-bottom;">*</span>',
|
|
||||||
// name: 'executePerson',
|
|
||||||
// anchor:'95%'
|
|
||||||
// }]
|
|
||||||
// }]
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
// 最后一行
|
|
||||||
FormRow endLineRow = Rows[endLineIndex];
|
|
||||||
string rowId = String.Format("{0}_row{1}", XID, endLineIndex);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
string defaultColumnWidthStr = (1.0 / columnCount).ToString("F2", System.Globalization.CultureInfo.InvariantCulture);
|
|
||||||
string[] columnWidths = ResolveColumnWidths(columnCount, Rows[startLineIndex].ColumnWidths, defaultColumnWidthStr);
|
|
||||||
|
|
||||||
// row_column
|
|
||||||
JsArrayBuilder rowColumnScriptsBuilder = new JsArrayBuilder();
|
|
||||||
for (int columnIndex = 0; columnIndex < columnCount; columnIndex++)
|
|
||||||
{
|
|
||||||
#region 计算每一列的值
|
|
||||||
|
|
||||||
// 循环每一列
|
|
||||||
JsArrayBuilder fieldsAB = new JsArrayBuilder();
|
|
||||||
for (int rowIndex = startLineIndex; rowIndex <= endLineIndex; rowIndex++)
|
|
||||||
{
|
|
||||||
FormRow currentRow = Rows[rowIndex];
|
|
||||||
|
|
||||||
if (columnIndex <= GetRowColumnCount(currentRow) - 1)
|
|
||||||
{
|
|
||||||
ControlBase component = GetRowColumnControl(currentRow, columnIndex);
|
|
||||||
if (component != null)
|
|
||||||
{
|
|
||||||
fieldsAB.AddProperty(String.Format("{0}", component.XID), true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 当前列的创建JS
|
|
||||||
JsObjectBuilder columnOB = new JsObjectBuilder();
|
|
||||||
string columnWidth = columnWidths[columnIndex];
|
|
||||||
if (Convert.ToDouble(columnWidth) <= 1.0)
|
|
||||||
{
|
|
||||||
columnOB.AddProperty("columnWidth", columnWidths[columnIndex], true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
columnOB.AddProperty("width", columnWidths[columnIndex], true);
|
|
||||||
}
|
|
||||||
|
|
||||||
columnOB.AddProperty("layout", "anchor");
|
|
||||||
columnOB.AddProperty("border", false);
|
|
||||||
columnOB.AddProperty("id", rowId + "_column" + columnIndex.ToString());
|
|
||||||
|
|
||||||
// 如果不是最后一列,则默认距离右侧 5px
|
|
||||||
if (columnIndex != columnCount - 1)
|
|
||||||
{
|
|
||||||
columnOB.AddProperty("margin", "0 5 0 0");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 有可能为空
|
|
||||||
if (fieldsAB.Count > 0)
|
|
||||||
{
|
|
||||||
columnOB.AddProperty("items", fieldsAB.ToString(), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
rowColumnScriptsBuilder.AddProperty(columnOB.ToString(), true);
|
|
||||||
|
|
||||||
// 现在采取的是安全的ajax,不会出现下面的情况
|
|
||||||
//// 所有Layout=form的地方必须用Ext.FormPanel,否则删除时不会把FieldLabek删除掉
|
|
||||||
//rowColumnScriptsBuilder.AddProperty(String.Format("new Ext.FormPanel({0})", columnOB.ToString()), true);
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
|
|
||||||
// 外面的JS(X.__Panel1_UpdatePanelConnector1_Panel7_Form5_row0)
|
|
||||||
JsObjectBuilder rowBuilder = new JsObjectBuilder();
|
|
||||||
rowBuilder.AddProperty("layout", "column");
|
|
||||||
rowBuilder.AddProperty("border", false);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 有可能为空
|
|
||||||
if (rowColumnScriptsBuilder.Count > 0)
|
|
||||||
{
|
|
||||||
rowBuilder.AddProperty("items", rowColumnScriptsBuilder.ToString(), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 把当前节点添加到结果集合中
|
|
||||||
rowIdsBuilder.AddProperty(String.Format("{0}", rowId), true);
|
|
||||||
rowBuilder.AddProperty("id", rowId);
|
|
||||||
|
|
||||||
// 注意要注册 最后 一个 Row的脚本
|
|
||||||
return String.Format("var {0}=Ext.create('Ext.panel.Panel',{1});", rowId, rowBuilder.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 添加Items变量
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="ab"></param>
|
|
||||||
/// <param name="id"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
private void AddItemScript(JsArrayBuilder ab, string id)
|
|
||||||
{
|
|
||||||
ab.AddProperty(String.Format("{0}", id), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 取得当前行的列数
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="row"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
private int GetRowColumnCount(FormRow row)
|
|
||||||
{
|
|
||||||
int fieldCount = 0;
|
|
||||||
|
|
||||||
foreach (Control c in row.Controls)
|
|
||||||
{
|
|
||||||
if (c is ControlBase)
|
|
||||||
{
|
|
||||||
fieldCount++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region oldcode
|
#region oldcode
|
||||||
//if (row.ColumnCount == null)
|
///// <summary>
|
||||||
|
///// 处理列
|
||||||
|
///// </summary>
|
||||||
|
///// <returns></returns>
|
||||||
|
//private void ResolveRows(ref string rowScriptsStr, ref string rowIdsStr)
|
||||||
//{
|
//{
|
||||||
// return fieldCount;
|
// JsArrayBuilder rowIdsBuilder = new JsArrayBuilder();
|
||||||
|
|
||||||
|
// // 上一行的列数
|
||||||
|
// int lastRowColumnCount = 1;
|
||||||
|
// // 上一行的列数
|
||||||
|
// string lastRowColumnWidths = String.Empty;
|
||||||
|
// // 是否已经开始多列
|
||||||
|
// bool isMultiColumnStarted = false;
|
||||||
|
// // 多列的开始行的序号
|
||||||
|
// int multiColumnStartLineIndex = 0;
|
||||||
|
|
||||||
|
// for (int i = 0, rowCount = Rows.Count; i < rowCount; i++)
|
||||||
|
// {
|
||||||
|
// FormRow currentRow = Rows[i];
|
||||||
|
// int currentRowColumnCount = GetRowColumnCount(currentRow);
|
||||||
|
// string currentRowColumnWidths = currentRow.ColumnWidths;
|
||||||
|
|
||||||
|
// if (currentRowColumnCount == 0)
|
||||||
|
// {
|
||||||
|
// // 如果当前行为空,则跳过此行
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// else if (currentRowColumnCount == 1)
|
||||||
|
// {
|
||||||
|
// if (isMultiColumnStarted)
|
||||||
|
// {
|
||||||
|
// // 如果上一行是多列行,则添加本行之上的所有行
|
||||||
|
// rowScriptsStr += AddColumnScript(rowIdsBuilder, multiColumnStartLineIndex, i - 1, lastRowColumnCount);
|
||||||
|
// //rowScriptsStr += "\r\n";
|
||||||
|
|
||||||
|
// // 开始重置记录本行为多列的开始
|
||||||
|
// isMultiColumnStarted = false;
|
||||||
|
// multiColumnStartLineIndex = 0;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // 如果当前行的列数为1,则直接添加Field元素
|
||||||
|
// //AddItemScript(ab, currentRow.Fields[0].ClientID);
|
||||||
|
// ControlBase component = GetRowColumnControl(currentRow, 0);
|
||||||
|
// if (component != null)
|
||||||
|
// {
|
||||||
|
// rowIdsBuilder.AddProperty(String.Format("{0}", component.XID), true);
|
||||||
|
// }
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// if (row.ColumnCount.Value > fieldCount)
|
// // 如果本行是多列
|
||||||
|
// if (!isMultiColumnStarted)
|
||||||
// {
|
// {
|
||||||
// return row.ColumnCount.Value;
|
// // 如果上一行还是单列的话,则开始多列
|
||||||
|
// isMultiColumnStarted = true;
|
||||||
|
// multiColumnStartLineIndex = i;
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
|
// if (lastRowColumnCount == currentRowColumnCount && lastRowColumnWidths == currentRowColumnWidths)
|
||||||
|
// {
|
||||||
|
// // 如果上一行的列数和本行的列数相同(并且上一行每列的宽度和本行的每列宽度也一样),则继续下一行
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// // 如果上一行的列数和本行的列数不相同,则添加本行之上的所有行
|
||||||
|
// rowScriptsStr += AddColumnScript(rowIdsBuilder, multiColumnStartLineIndex, i - 1, lastRowColumnCount);
|
||||||
|
// //rowScriptsStr += "\r\n";
|
||||||
|
|
||||||
|
// // 开始重新记录本行为多列的开始
|
||||||
|
// isMultiColumnStarted = true;
|
||||||
|
// multiColumnStartLineIndex = i;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// lastRowColumnCount = currentRowColumnCount;
|
||||||
|
// lastRowColumnWidths = currentRowColumnWidths;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// // 还要判断一下(如果最后一行是两列的情况)
|
||||||
|
// if (isMultiColumnStarted)
|
||||||
|
// {
|
||||||
|
// rowScriptsStr += AddColumnScript(rowIdsBuilder, multiColumnStartLineIndex, Rows.Count - 1, lastRowColumnCount);
|
||||||
|
// //rowScriptsStr += "\r\n";
|
||||||
|
// }
|
||||||
|
|
||||||
|
// rowIdsStr = rowIdsBuilder.ToString();
|
||||||
|
//}
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 添加列
|
||||||
|
///// </summary>
|
||||||
|
///// <param name="rowIdsBuilder">行ID集合</param>
|
||||||
|
///// <param name="startLineIndex">开始行的索引(包含)</param>
|
||||||
|
///// <param name="endLineIndex">结束行的索引(包含)</param>
|
||||||
|
///// <param name="columnCount">行的列数</param>
|
||||||
|
//private string AddColumnScript(JsArrayBuilder rowIdsBuilder, int startLineIndex, int endLineIndex, int columnCount)
|
||||||
|
//{
|
||||||
|
// // 注意,注册脚本的控件应该是最后一个 Row
|
||||||
|
// // 假如有从上之下这些控件: Row1(Field1,Field2), Row2(Field3,Field4),Row3(Field5)
|
||||||
|
// // 则渲染时,JS脚本的执行顺序为:Field1,Field2,Row1,Field3,Field4,Row2,Field5,Row3
|
||||||
|
// // 所以,如果column Panel的脚本注册为控件 Row3,则能保证所有的子控件已经初始化
|
||||||
|
// // 需要注意的是:在此设置脚本内容到 Row3 控件
|
||||||
|
// // 现在已经不是这样的了!!!,Row不在是一个控件
|
||||||
|
|
||||||
|
// #region examples
|
||||||
|
|
||||||
|
|
||||||
|
// // {
|
||||||
|
// // layout: 'column',
|
||||||
|
// // border:false,
|
||||||
|
// // items:[{
|
||||||
|
// // columnWidth: .5,
|
||||||
|
// // layout: 'form',
|
||||||
|
// // border:false,
|
||||||
|
// // items:[{
|
||||||
|
// // xtype:'combo',
|
||||||
|
// // store: nextStepStore,
|
||||||
|
// // displayField:'text',
|
||||||
|
// // valueField:'value',
|
||||||
|
// // typeAhead: true,
|
||||||
|
// // mode: 'local',
|
||||||
|
// // triggerAction: 'all',
|
||||||
|
// // value:'1',
|
||||||
|
// // emptyText:'请选择下一步',
|
||||||
|
// // selectOnFocus:true,
|
||||||
|
// // allowBlank:false,
|
||||||
|
// // fieldLabel: '下一步',
|
||||||
|
// // labelSeparator:' <span style="color:red;vertical-align:text-bottom;">*</span>',
|
||||||
|
// // name: 'nextStep',
|
||||||
|
// // anchor:'95%'
|
||||||
|
// // }]
|
||||||
|
// // },{
|
||||||
|
// // columnWidth: .5,
|
||||||
|
// // layout: 'form',
|
||||||
|
// // border:false,
|
||||||
|
// // items:[{
|
||||||
|
// // xtype:'combo',
|
||||||
|
// // store: executePersonStore,
|
||||||
|
// // displayField:'text',
|
||||||
|
// // valueField:'value',
|
||||||
|
// // typeAhead: true,
|
||||||
|
// // mode: 'local',
|
||||||
|
// // triggerAction: 'all',
|
||||||
|
// // value:'1',
|
||||||
|
// // emptyText:'请选择执行人',
|
||||||
|
// // selectOnFocus:true,
|
||||||
|
// // allowBlank:false,
|
||||||
|
// // fieldLabel: '执行人',
|
||||||
|
// // labelSeparator:' <span style="color:red;vertical-align:text-bottom;">*</span>',
|
||||||
|
// // name: 'executePerson',
|
||||||
|
// // anchor:'95%'
|
||||||
|
// // }]
|
||||||
|
// // }]
|
||||||
|
// // }
|
||||||
|
|
||||||
|
|
||||||
|
// #endregion
|
||||||
|
|
||||||
|
|
||||||
|
// // 最后一行
|
||||||
|
// FormRow endLineRow = Rows[endLineIndex];
|
||||||
|
// string rowId = String.Format("{0}_row{1}", XID, endLineIndex);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// string defaultColumnWidthStr = (1.0 / columnCount).ToString("F2", System.Globalization.CultureInfo.InvariantCulture);
|
||||||
|
// string[] columnWidths = ResolveColumnWidths(columnCount, Rows[startLineIndex].ColumnWidths, defaultColumnWidthStr);
|
||||||
|
|
||||||
|
// // row_column
|
||||||
|
// JsArrayBuilder rowColumnScriptsBuilder = new JsArrayBuilder();
|
||||||
|
// for (int columnIndex = 0; columnIndex < columnCount; columnIndex++)
|
||||||
|
// {
|
||||||
|
// #region 计算每一列的值
|
||||||
|
|
||||||
|
// // 循环每一列
|
||||||
|
// JsArrayBuilder fieldsAB = new JsArrayBuilder();
|
||||||
|
// for (int rowIndex = startLineIndex; rowIndex <= endLineIndex; rowIndex++)
|
||||||
|
// {
|
||||||
|
// FormRow currentRow = Rows[rowIndex];
|
||||||
|
|
||||||
|
// if (columnIndex <= GetRowColumnCount(currentRow) - 1)
|
||||||
|
// {
|
||||||
|
// ControlBase component = GetRowColumnControl(currentRow, columnIndex);
|
||||||
|
// if (component != null)
|
||||||
|
// {
|
||||||
|
// fieldsAB.AddProperty(String.Format("{0}", component.XID), true);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // 当前列的创建JS
|
||||||
|
// JsObjectBuilder columnOB = new JsObjectBuilder();
|
||||||
|
// string columnWidth = columnWidths[columnIndex];
|
||||||
|
// if (Convert.ToDouble(columnWidth) <= 1.0)
|
||||||
|
// {
|
||||||
|
// columnOB.AddProperty("columnWidth", columnWidths[columnIndex], true);
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// columnOB.AddProperty("width", columnWidths[columnIndex], true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// columnOB.AddProperty("layout", "anchor");
|
||||||
|
// columnOB.AddProperty("border", false);
|
||||||
|
// columnOB.AddProperty("id", rowId + "_column" + columnIndex.ToString());
|
||||||
|
|
||||||
|
// // 如果不是最后一列,则默认距离右侧 5px
|
||||||
|
// if (columnIndex != columnCount - 1)
|
||||||
|
// {
|
||||||
|
// columnOB.AddProperty("margin", "0 5 0 0");
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // 有可能为空
|
||||||
|
// if (fieldsAB.Count > 0)
|
||||||
|
// {
|
||||||
|
// columnOB.AddProperty("items", fieldsAB.ToString(), true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// rowColumnScriptsBuilder.AddProperty(columnOB.ToString(), true);
|
||||||
|
|
||||||
|
// // 现在采取的是安全的ajax,不会出现下面的情况
|
||||||
|
// //// 所有Layout=form的地方必须用Ext.FormPanel,否则删除时不会把FieldLabek删除掉
|
||||||
|
// //rowColumnScriptsBuilder.AddProperty(String.Format("new Ext.FormPanel({0})", columnOB.ToString()), true);
|
||||||
|
|
||||||
|
// #endregion
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // 外面的JS(X.__Panel1_UpdatePanelConnector1_Panel7_Form5_row0)
|
||||||
|
// JsObjectBuilder rowBuilder = new JsObjectBuilder();
|
||||||
|
// rowBuilder.AddProperty("layout", "column");
|
||||||
|
// rowBuilder.AddProperty("border", false);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// // 有可能为空
|
||||||
|
// if (rowColumnScriptsBuilder.Count > 0)
|
||||||
|
// {
|
||||||
|
// rowBuilder.AddProperty("items", rowColumnScriptsBuilder.ToString(), true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// // 把当前节点添加到结果集合中
|
||||||
|
// rowIdsBuilder.AddProperty(String.Format("{0}", rowId), true);
|
||||||
|
// rowBuilder.AddProperty("id", rowId);
|
||||||
|
|
||||||
|
// // 注意要注册 最后 一个 Row的脚本
|
||||||
|
// return String.Format("var {0}=Ext.create('Ext.panel.Panel',{1});", rowId, rowBuilder.ToString());
|
||||||
|
//}
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 添加Items变量
|
||||||
|
///// </summary>
|
||||||
|
///// <param name="ab"></param>
|
||||||
|
///// <param name="id"></param>
|
||||||
|
///// <returns></returns>
|
||||||
|
//private void AddItemScript(JsArrayBuilder ab, string id)
|
||||||
|
//{
|
||||||
|
// ab.AddProperty(String.Format("{0}", id), true);
|
||||||
|
//}
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 取得当前行的列数
|
||||||
|
///// </summary>
|
||||||
|
///// <param name="row"></param>
|
||||||
|
///// <returns></returns>
|
||||||
|
//private int GetRowColumnCount(FormRow row)
|
||||||
|
//{
|
||||||
|
// int fieldCount = 0;
|
||||||
|
|
||||||
|
// foreach (Control c in row.Controls)
|
||||||
|
// {
|
||||||
|
// if (c is ControlBase)
|
||||||
|
// {
|
||||||
|
// fieldCount++;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// #region old code
|
||||||
|
// //if (row.ColumnCount == null)
|
||||||
|
// //{
|
||||||
|
// // return fieldCount;
|
||||||
|
// //}
|
||||||
|
// //else
|
||||||
|
// //{
|
||||||
|
// // if (row.ColumnCount.Value > fieldCount)
|
||||||
|
// // {
|
||||||
|
// // return row.ColumnCount.Value;
|
||||||
|
// // }
|
||||||
|
// // else
|
||||||
|
// // {
|
||||||
|
// // return fieldCount;
|
||||||
|
// // }
|
||||||
|
// //}
|
||||||
|
// #endregion
|
||||||
|
|
||||||
// return fieldCount;
|
// return fieldCount;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 取得当前行 columnIndex 列的控件
|
||||||
|
///// </summary>
|
||||||
|
///// <param name="row"></param>
|
||||||
|
///// <param name="columnIndex"></param>
|
||||||
|
///// <returns></returns>
|
||||||
|
//private ControlBase GetRowColumnControl(FormRow row, int columnIndex)
|
||||||
|
//{
|
||||||
|
// int index = 0;
|
||||||
|
// foreach (Control c in row.Controls)
|
||||||
|
// {
|
||||||
|
// if (c is ControlBase)
|
||||||
|
// {
|
||||||
|
// if (columnIndex == index)
|
||||||
|
// {
|
||||||
|
// return c as ControlBase;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// index++;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return null;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//private string[] ResolveColumnWidths(int columnCount, string columnWidths, string defaultColumnWidthStr)
|
||||||
|
//{
|
||||||
|
// string[] results = null;
|
||||||
|
// if (!String.IsNullOrEmpty(columnWidths))
|
||||||
|
// {
|
||||||
|
// string[] columnWidthArray = columnWidths.Split(' ');
|
||||||
|
// if (columnWidthArray.Length == columnCount)
|
||||||
|
// {
|
||||||
|
// results = columnWidthArray;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (results == null)
|
||||||
|
// {
|
||||||
|
// results = new string[columnCount];
|
||||||
|
// for (int i = 0; i < columnCount; i++)
|
||||||
|
// {
|
||||||
|
// results[i] = defaultColumnWidthStr;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return results;
|
||||||
//}
|
//}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
return fieldCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 取得当前行 columnIndex 列的控件
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="row"></param>
|
|
||||||
/// <param name="columnIndex"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
private ControlBase GetRowColumnControl(FormRow row, int columnIndex)
|
|
||||||
{
|
|
||||||
int index = 0;
|
|
||||||
foreach (Control c in row.Controls)
|
|
||||||
{
|
|
||||||
if (c is ControlBase)
|
|
||||||
{
|
|
||||||
if (columnIndex == index)
|
|
||||||
{
|
|
||||||
return c as ControlBase;
|
|
||||||
}
|
|
||||||
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private string[] ResolveColumnWidths(int columnCount, string columnWidths, string defaultColumnWidthStr)
|
|
||||||
{
|
|
||||||
string[] results = null;
|
|
||||||
if (!String.IsNullOrEmpty(columnWidths))
|
|
||||||
{
|
|
||||||
string[] columnWidthArray = columnWidths.Split(' ');
|
|
||||||
if (columnWidthArray.Length == columnCount)
|
|
||||||
{
|
|
||||||
results = columnWidthArray;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (results == null)
|
|
||||||
{
|
|
||||||
results = new string[columnCount];
|
|
||||||
for (int i = 0; i < columnCount; i++)
|
|
||||||
{
|
|
||||||
results[i] = defaultColumnWidthStr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return results;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region old code
|
#region old code
|
||||||
|
@ -50,18 +50,55 @@ namespace FineUI
|
|||||||
[ParseChildren(true)]
|
[ParseChildren(true)]
|
||||||
[PersistChildren(false)]
|
[PersistChildren(false)]
|
||||||
[ControlBuilder(typeof(NotAllowWhitespaceLiteralsBuilder))]
|
[ControlBuilder(typeof(NotAllowWhitespaceLiteralsBuilder))]
|
||||||
public class FormRow : ControlBase
|
public class FormRow : Container
|
||||||
{
|
{
|
||||||
|
#region Unsupported Properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 不支持此属性
|
||||||
|
/// </summary>
|
||||||
|
[Browsable(false)]
|
||||||
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||||
|
public override Layout Layout
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Layout.Column;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 各列的宽度,空格分割
|
||||||
|
///// </summary>
|
||||||
|
//[Category(CategoryName.OPTIONS)]
|
||||||
|
//[NotifyParentProperty(true)]
|
||||||
|
//[DefaultValue("")]
|
||||||
|
//[Description("各列的宽度,空格分割")]
|
||||||
|
//public string ColumnWidths
|
||||||
|
//{
|
||||||
|
// get
|
||||||
|
// {
|
||||||
|
// object obj = FState["ColumnWidths"];
|
||||||
|
// return obj == null ? "" : (string)obj;
|
||||||
|
// }
|
||||||
|
// set
|
||||||
|
// {
|
||||||
|
// FState["ColumnWidths"] = ResolveColumnWidths(value);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 各列的宽度,空格分割
|
/// 以空格分开的各列宽度(可以是像素数或者百分比,比如200px 50% 50%)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Category(CategoryName.OPTIONS)]
|
[Category(CategoryName.OPTIONS)]
|
||||||
[NotifyParentProperty(true)]
|
[NotifyParentProperty(true)]
|
||||||
[DefaultValue("")]
|
[DefaultValue("")]
|
||||||
[Description("各列的宽度,空格分割")]
|
[Description("以空格分开的各列宽度(可以是像素数或者百分比,比如200px 50% 50%)")]
|
||||||
public string ColumnWidths
|
public string ColumnWidths
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -71,7 +108,7 @@ namespace FineUI
|
|||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
FState["ColumnWidths"] = ResolveColumnWidths(value);
|
FState["ColumnWidths"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,59 +165,246 @@ namespace FineUI
|
|||||||
base.OnFirstPreRender();
|
base.OnFirstPreRender();
|
||||||
|
|
||||||
|
|
||||||
|
OB.AddProperty("border", false);
|
||||||
|
OB.AddProperty("header", false);
|
||||||
|
|
||||||
|
Form parentForm = Parent as Form;
|
||||||
|
if (parentForm == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int formrowItemsSpace = Convert.ToInt32(parentForm.FormRowItemsSpace.Value);
|
||||||
|
|
||||||
|
|
||||||
//// 目的:子控件的JS代码在父控件的前面
|
if (Items.Count > 0)
|
||||||
//AddStartupScript(this, String.Empty);
|
{
|
||||||
AddStartupScript(String.Empty);
|
#region oldcode
|
||||||
|
/*
|
||||||
|
* 增加中间的分割面板,会对显示隐藏表单字段造成影响
|
||||||
|
int currentItemCount = 0;
|
||||||
|
JsArrayBuilder ab = new JsArrayBuilder();
|
||||||
|
foreach (ControlBase item in Items)
|
||||||
|
{
|
||||||
|
if (item.Visible)
|
||||||
|
{
|
||||||
|
if (currentItemCount > 0)
|
||||||
|
{
|
||||||
|
OptionBuilder separatorOB = new OptionBuilder();
|
||||||
|
separatorOB.AddProperty("type", "panelbase");
|
||||||
|
separatorOB.AddProperty("width", 8);
|
||||||
|
ab.AddProperty(String.Format("{0}", separatorOB), true);
|
||||||
|
}
|
||||||
|
ab.AddProperty(String.Format("{0}", item.XID), true);
|
||||||
|
currentItemCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OB.AddProperty("items", ab.ToString(), true);
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
// 为子项添加布局属性
|
||||||
|
int columnCount = Items.Count;
|
||||||
|
string defaultColumnWidthStr = (1.0 / columnCount).ToString("F2", System.Globalization.CultureInfo.InvariantCulture);
|
||||||
|
List<string> columnWidths = GetTrimedColumnWidths();
|
||||||
|
|
||||||
|
// 用户自定义ColumnWidths是否和Items的个数匹配
|
||||||
|
bool isColumnWidthsMatch = false;
|
||||||
|
if (columnWidths.Count == columnCount)
|
||||||
|
{
|
||||||
|
isColumnWidthsMatch = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Dictionary<string, JsObjectBuilder> buttonOptions = new Dictionary<string, JsObjectBuilder>();
|
||||||
|
for (int i = 0; i < columnCount; i++)
|
||||||
|
{
|
||||||
|
var comp = Items[i] as Component;
|
||||||
|
|
||||||
|
// 如果FormRow的子项是 Button,则用一个面板将其包裹起来,否则按钮的宽度会很长
|
||||||
|
bool isbutton = false;
|
||||||
|
JsObjectBuilder buttonPanelOB = new JsObjectBuilder();
|
||||||
|
if (comp is Button)
|
||||||
|
{
|
||||||
|
isbutton = true;
|
||||||
|
|
||||||
|
buttonPanelOB.AddProperty("xtype", "panel");
|
||||||
|
buttonPanelOB.AddProperty("header", false);
|
||||||
|
buttonPanelOB.AddProperty("border", false);
|
||||||
|
|
||||||
|
buttonPanelOB.AddProperty("items", String.Format("[{0}]", comp.XID), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Component
|
||||||
|
if (comp != null)
|
||||||
|
{
|
||||||
|
// 不是最后一列的话,加上空白间隔
|
||||||
|
if (columnCount > 1 && i != columnCount - 1)
|
||||||
|
{
|
||||||
|
if (isbutton)
|
||||||
|
{
|
||||||
|
//buttonOB.AddProperty("marginRight", formrowItemsSpace);
|
||||||
|
buttonPanelOB.AddProperty("style", String.Format("margin-right:{0}px;", formrowItemsSpace));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//// 如果尚未设置 MarginRight
|
||||||
|
//if (comp.MarginRight == Unit.Empty)
|
||||||
|
//{
|
||||||
|
// comp.MarginRight = Unit.Pixel(formrowItemsSpace);
|
||||||
|
//}
|
||||||
|
//if (String.IsNullOrEmpty(comp.Margin))
|
||||||
|
//{
|
||||||
|
// comp.Margin = String.Format("0 {0} 0 0", formrowItemsSpace);
|
||||||
|
//}
|
||||||
|
comp.CssStyle += String.Format("margin-right:{0}px;", formrowItemsSpace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region BoxComponent
|
||||||
|
var boxcomp = comp as BoxComponent;
|
||||||
|
if (boxcomp != null)
|
||||||
|
{
|
||||||
|
if (isColumnWidthsMatch)
|
||||||
|
{
|
||||||
|
string columnWidth = StringUtil.ConvertPercentageToDecimalString(columnWidths[i]);
|
||||||
|
if (Convert.ToDouble(columnWidth) <= 1.0)
|
||||||
|
{
|
||||||
|
if (isbutton)
|
||||||
|
{
|
||||||
|
buttonPanelOB.AddProperty("columnWidth", columnWidth, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
boxcomp.ColumnWidth = columnWidth;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Unit unitColumnWidth = Unit.Parse(columnWidth);
|
||||||
|
|
||||||
|
if (isbutton)
|
||||||
|
{
|
||||||
|
buttonPanelOB.AddProperty("width", unitColumnWidth.Value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
boxcomp.Width = unitColumnWidth;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (isbutton)
|
||||||
|
{
|
||||||
|
buttonPanelOB.AddProperty("columnWidth", defaultColumnWidthStr, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
boxcomp.ColumnWidth = defaultColumnWidthStr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
if (isbutton)
|
||||||
|
{
|
||||||
|
buttonOptions.Add(comp.XID, buttonPanelOB);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
JsArrayBuilder ab = new JsArrayBuilder();
|
||||||
|
foreach (ControlBase item in Items)
|
||||||
|
{
|
||||||
|
if (item.Visible)
|
||||||
|
{
|
||||||
|
string itemXID = item.XID;
|
||||||
|
if (buttonOptions.ContainsKey(itemXID))
|
||||||
|
{
|
||||||
|
itemXID = buttonOptions[itemXID].ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
ab.AddProperty(itemXID, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OB.AddProperty("items", ab.ToString(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 自定义样式
|
||||||
|
OB.AddProperty("cls", "f-formrow");
|
||||||
|
|
||||||
|
string jsContent = String.Format("var {0}=Ext.create('Ext.panel.Panel',{1});", XID, OB.ToString());
|
||||||
|
AddStartupScript(jsContent);
|
||||||
|
|
||||||
|
////// 目的:子控件的JS代码在父控件的前面
|
||||||
|
////AddStartupScript(this, String.Empty);
|
||||||
|
//AddStartupScript(String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private List<string> GetTrimedColumnWidths()
|
||||||
|
{
|
||||||
|
List<string> widths = new List<string>();
|
||||||
|
foreach (string width in ColumnWidths.Split(' '))
|
||||||
|
{
|
||||||
|
string trimedWith = width.Trim();
|
||||||
|
if (!String.IsNullOrEmpty(trimedWith))
|
||||||
|
{
|
||||||
|
widths.Add(trimedWith);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return widths;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region private ResolveColumnWidths
|
#region private ResolveColumnWidths
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 格式化widths
|
///// 格式化widths
|
||||||
/// </summary>
|
///// </summary>
|
||||||
/// <param name="widths"></param>
|
///// <param name="widths"></param>
|
||||||
/// <returns></returns>
|
///// <returns></returns>
|
||||||
private string ResolveColumnWidths(string widths)
|
//private string ResolveColumnWidths(string widths)
|
||||||
{
|
//{
|
||||||
List<string> widthList = new List<string>();
|
// List<string> widthList = new List<string>();
|
||||||
|
|
||||||
string[] widthArray = widths.Split(' ');
|
// string[] widthArray = widths.Split(' ');
|
||||||
foreach (string s in widthArray)
|
// foreach (string s in widthArray)
|
||||||
{
|
// {
|
||||||
string tmp = s.Trim();
|
// string tmp = s.Trim();
|
||||||
if (!String.IsNullOrEmpty(tmp))
|
// if (!String.IsNullOrEmpty(tmp))
|
||||||
{
|
// {
|
||||||
widthList.Add(ResolveColumnWidth(tmp));
|
// widthList.Add(ResolveColumnWidth(tmp));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
// StringBuilder sb = new StringBuilder();
|
||||||
foreach (string s in widthList)
|
// foreach (string s in widthList)
|
||||||
{
|
// {
|
||||||
sb.AppendFormat("{0} ", s);
|
// sb.AppendFormat("{0} ", s);
|
||||||
}
|
// }
|
||||||
|
|
||||||
return sb.ToString().TrimEnd();
|
// return sb.ToString().TrimEnd();
|
||||||
}
|
//}
|
||||||
|
|
||||||
private string ResolveColumnWidth(string width)
|
//private string ResolveColumnWidth(string width)
|
||||||
{
|
//{
|
||||||
string result = width;
|
// string result = width;
|
||||||
if (result.EndsWith("%"))
|
// if (result.EndsWith("%"))
|
||||||
{
|
// {
|
||||||
result = (Convert.ToInt32(width.TrimEnd('%')) * 0.01).ToString("F2", System.Globalization.CultureInfo.InvariantCulture);
|
// result = (Convert.ToInt32(width.TrimEnd('%')) * 0.01).ToString("F2", System.Globalization.CultureInfo.InvariantCulture);
|
||||||
}
|
// }
|
||||||
else if (result.ToLower().EndsWith("px"))
|
// else if (result.ToLower().EndsWith("px"))
|
||||||
{
|
// {
|
||||||
result = result.ToLower().Substring(0, result.Length - 2);
|
// result = result.ToLower().Substring(0, result.Length - 2);
|
||||||
}
|
// }
|
||||||
|
|
||||||
return result;
|
// return result;
|
||||||
}
|
//}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -316,6 +316,26 @@ namespace FineUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 启用树中的文字选择
|
||||||
|
/// </summary>
|
||||||
|
[Category(CategoryName.OPTIONS)]
|
||||||
|
[DefaultValue(false)]
|
||||||
|
[Description("启用树中的文字选择")]
|
||||||
|
public bool EnableTextSelection
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
object obj = FState["EnableTextSelection"];
|
||||||
|
return obj == null ? false : (bool)obj;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
FState["EnableTextSelection"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region DataSource
|
#region DataSource
|
||||||
@ -599,9 +619,9 @@ namespace FineUI
|
|||||||
treeNode.EnableExpandEvent = ja2[19].Value<int>() == 1 ? true : false;
|
treeNode.EnableExpandEvent = ja2[19].Value<int>() == 1 ? true : false;
|
||||||
treeNode.EnableCollapseEvent = ja2[20].Value<int>() == 1 ? true : false;
|
treeNode.EnableCollapseEvent = ja2[20].Value<int>() == 1 ? true : false;
|
||||||
|
|
||||||
|
treeNode.CssClass = ja2[21].Value<string>();
|
||||||
|
|
||||||
|
JArray childNodes = ja2[22].Value<JArray>();
|
||||||
JArray childNodes = ja2[21].Value<JArray>();
|
|
||||||
if (childNodes != null && childNodes.Count > 0)
|
if (childNodes != null && childNodes.Count > 0)
|
||||||
{
|
{
|
||||||
FromNodesJArray(childNodes, treeNode.Nodes);
|
FromNodesJArray(childNodes, treeNode.Nodes);
|
||||||
@ -639,7 +659,9 @@ namespace FineUI
|
|||||||
// 19 - EnableExpandEvent
|
// 19 - EnableExpandEvent
|
||||||
// 20 - EnableCollapseEvent
|
// 20 - EnableCollapseEvent
|
||||||
|
|
||||||
// 21 - Nodes
|
// 21 - CssClass
|
||||||
|
|
||||||
|
// 22 - Nodes
|
||||||
ja2.Add(node.Text);
|
ja2.Add(node.Text);
|
||||||
ja2.Add(node.Leaf ? 1 : 0);
|
ja2.Add(node.Leaf ? 1 : 0);
|
||||||
ja2.Add(node.NodeID);
|
ja2.Add(node.NodeID);
|
||||||
@ -669,6 +691,7 @@ namespace FineUI
|
|||||||
ja2.Add(node.EnableExpandEvent ? 1 : 0);
|
ja2.Add(node.EnableExpandEvent ? 1 : 0);
|
||||||
ja2.Add(node.EnableCollapseEvent ? 1 : 0);
|
ja2.Add(node.EnableCollapseEvent ? 1 : 0);
|
||||||
|
|
||||||
|
ja2.Add(node.CssClass);
|
||||||
|
|
||||||
if (node.Nodes != null && node.Nodes.Count > 0)
|
if (node.Nodes != null && node.Nodes.Count > 0)
|
||||||
{
|
{
|
||||||
@ -1034,6 +1057,22 @@ namespace FineUI
|
|||||||
|
|
||||||
//ResourceManager.Instance.AddJavaScriptComponent("tree");
|
//ResourceManager.Instance.AddJavaScriptComponent("tree");
|
||||||
|
|
||||||
|
#region viewConfig
|
||||||
|
|
||||||
|
JsObjectBuilder viewBuilder = new JsObjectBuilder();
|
||||||
|
|
||||||
|
if (EnableTextSelection)
|
||||||
|
{
|
||||||
|
viewBuilder.AddProperty("enableTextSelection", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewBuilder.Count > 0)
|
||||||
|
{
|
||||||
|
OB.AddProperty("viewConfig", viewBuilder);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region options
|
#region options
|
||||||
|
|
||||||
OB.AddProperty("useArrows", EnableArrows);
|
OB.AddProperty("useArrows", EnableArrows);
|
||||||
|
@ -309,6 +309,27 @@ namespace FineUI
|
|||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
|
private string _cssClass = String.Empty;
|
||||||
|
/// <summary>
|
||||||
|
/// 节点样式类
|
||||||
|
/// </summary>
|
||||||
|
[Category(CategoryName.OPTIONS)]
|
||||||
|
[DefaultValue("")]
|
||||||
|
[Description("节点样式类")]
|
||||||
|
public string CssClass
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _cssClass;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_cssClass = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private string _text = String.Empty;
|
private string _text = String.Empty;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文本
|
/// 文本
|
||||||
|
@ -430,7 +430,7 @@ namespace FineUI
|
|||||||
[Category(CategoryName.OPTIONS)]
|
[Category(CategoryName.OPTIONS)]
|
||||||
[DefaultValue(typeof(Unit), "100")]
|
[DefaultValue(typeof(Unit), "100")]
|
||||||
[Description("最小高度")]
|
[Description("最小高度")]
|
||||||
public Unit MinHeight
|
public new Unit MinHeight
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -450,7 +450,7 @@ namespace FineUI
|
|||||||
[Category(CategoryName.OPTIONS)]
|
[Category(CategoryName.OPTIONS)]
|
||||||
[DefaultValue(typeof(Unit), "200")]
|
[DefaultValue(typeof(Unit), "200")]
|
||||||
[Description("最小宽度")]
|
[Description("最小宽度")]
|
||||||
public Unit MinWidth
|
public new Unit MinWidth
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -1493,7 +1493,7 @@ namespace FineUI
|
|||||||
/// <returns>客户端脚本</returns>
|
/// <returns>客户端脚本</returns>
|
||||||
public string GetIFrameCustomEventReference(string eventArgument, bool validateForms)
|
public string GetIFrameCustomEventReference(string eventArgument, bool validateForms)
|
||||||
{
|
{
|
||||||
return String.Format("F.wnd.getIFrameWindowObject({0}).F.customEvent({1}, {2});", ScriptID, JsHelper.Enquote(eventArgument), validateForms.ToString().ToLower());
|
return String.Format("F.wnd.getIFrameWindowObject({0}).F.f_customEvent({1}, {2});", ScriptID, JsHelper.Enquote(eventArgument), validateForms.ToString().ToLower());
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -45,7 +45,17 @@ namespace FineUI
|
|||||||
public int RowIndex
|
public int RowIndex
|
||||||
{
|
{
|
||||||
get { return _rowIndex; }
|
get { return _rowIndex; }
|
||||||
set { _rowIndex = value; }
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private int _columnIndex;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ÁÐË÷Òý
|
||||||
|
/// </summary>
|
||||||
|
public int ColumnIndex
|
||||||
|
{
|
||||||
|
get { return _columnIndex; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private string _columnID;
|
private string _columnID;
|
||||||
@ -56,18 +66,33 @@ namespace FineUI
|
|||||||
public string ColumnID
|
public string ColumnID
|
||||||
{
|
{
|
||||||
get { return _columnID; }
|
get { return _columnID; }
|
||||||
set { _columnID = value; }
|
}
|
||||||
|
|
||||||
|
private string _rowID;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ÐÐID
|
||||||
|
/// </summary>
|
||||||
|
public string RowID
|
||||||
|
{
|
||||||
|
get { return _rowID; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构造函数
|
/// 构造函数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="rowIndex">行索引</param>
|
/// <param name="rowIndex">行索引</param>
|
||||||
/// /// <param name="columnID">ÁÐID</param>
|
/// <param name="rowID">ÐÐID</param>
|
||||||
public GridAfterEditEventArgs(int rowIndex, string columnID)
|
/// <param name="columnIndex">ÁÐË÷Òý</param>
|
||||||
|
/// <param name="columnID">ÁÐID</param>
|
||||||
|
public GridAfterEditEventArgs(int rowIndex, string rowID, int columnIndex, string columnID)
|
||||||
{
|
{
|
||||||
_rowIndex = rowIndex;
|
_rowIndex = rowIndex;
|
||||||
|
_rowID = rowID;
|
||||||
|
|
||||||
|
_columnIndex = columnIndex;
|
||||||
_columnID = columnID;
|
_columnID = columnID;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -45,9 +45,20 @@ namespace FineUI
|
|||||||
public int RowIndex
|
public int RowIndex
|
||||||
{
|
{
|
||||||
get { return _rowIndex; }
|
get { return _rowIndex; }
|
||||||
set { _rowIndex = value; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string _rowID;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ÐÐID
|
||||||
|
/// </summary>
|
||||||
|
public string RowID
|
||||||
|
{
|
||||||
|
get { return _rowID; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private int _columnIndex;
|
private int _columnIndex;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -56,10 +67,22 @@ namespace FineUI
|
|||||||
public int ColumnIndex
|
public int ColumnIndex
|
||||||
{
|
{
|
||||||
get { return _columnIndex; }
|
get { return _columnIndex; }
|
||||||
set { _columnIndex = value; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private string _columnID;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ÁÐID
|
||||||
|
/// </summary>
|
||||||
|
public string ColumnID
|
||||||
|
{
|
||||||
|
get { return _columnID; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private string _commandName;
|
private string _commandName;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -68,7 +91,6 @@ namespace FineUI
|
|||||||
public string CommandName
|
public string CommandName
|
||||||
{
|
{
|
||||||
get { return _commandName; }
|
get { return _commandName; }
|
||||||
set { _commandName = value; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -80,7 +102,6 @@ namespace FineUI
|
|||||||
public string CommandArgument
|
public string CommandArgument
|
||||||
{
|
{
|
||||||
get { return _commandArgument; }
|
get { return _commandArgument; }
|
||||||
set { _commandArgument = value; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -88,13 +109,17 @@ namespace FineUI
|
|||||||
/// 构造函数
|
/// 构造函数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="rowIndex">行索引</param>
|
/// <param name="rowIndex">行索引</param>
|
||||||
|
/// <param name="rowID">ÐÐID</param>
|
||||||
/// <param name="columnIndex">列索引</param>
|
/// <param name="columnIndex">列索引</param>
|
||||||
|
/// <param name="columnID">ÁÐID</param>
|
||||||
/// <param name="commandName">命令名称</param>
|
/// <param name="commandName">命令名称</param>
|
||||||
/// <param name="commandArgument">命令参数</param>
|
/// <param name="commandArgument">命令参数</param>
|
||||||
public GridCommandEventArgs(int rowIndex, int columnIndex, string commandName, string commandArgument)
|
public GridCommandEventArgs(int rowIndex, string rowID, int columnIndex, string columnID, string commandName, string commandArgument)
|
||||||
{
|
{
|
||||||
_rowIndex = rowIndex;
|
_rowIndex = rowIndex;
|
||||||
|
_rowID = rowID;
|
||||||
_columnIndex = columnIndex;
|
_columnIndex = columnIndex;
|
||||||
|
_columnID = columnID;
|
||||||
_commandName = commandName;
|
_commandName = commandName;
|
||||||
_commandArgument = commandArgument;
|
_commandArgument = commandArgument;
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,6 @@ namespace FineUI
|
|||||||
public object DataItem
|
public object DataItem
|
||||||
{
|
{
|
||||||
get { return _dataItem; }
|
get { return _dataItem; }
|
||||||
set { _dataItem = value; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -68,9 +67,9 @@ namespace FineUI
|
|||||||
public int RowIndex
|
public int RowIndex
|
||||||
{
|
{
|
||||||
get { return _rowIndex; }
|
get { return _rowIndex; }
|
||||||
set { _rowIndex = value; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构造函数
|
/// 构造函数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -45,16 +45,28 @@ namespace FineUI
|
|||||||
public int RowIndex
|
public int RowIndex
|
||||||
{
|
{
|
||||||
get { return _rowIndex; }
|
get { return _rowIndex; }
|
||||||
set { _rowIndex = value; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string _rowID;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ÐÐID
|
||||||
|
/// </summary>
|
||||||
|
public string RowID
|
||||||
|
{
|
||||||
|
get { return _rowID; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构造函数
|
/// 构造函数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="rowIndex">行索引</param>
|
/// <param name="rowIndex">行索引</param>
|
||||||
public GridRowClickEventArgs(int rowIndex)
|
/// <param name="rowID">ÐÐID</param>
|
||||||
|
public GridRowClickEventArgs(int rowIndex, string rowID)
|
||||||
{
|
{
|
||||||
_rowIndex = rowIndex;
|
_rowIndex = rowIndex;
|
||||||
|
_rowID = rowID;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -37,53 +37,58 @@ namespace FineUI
|
|||||||
public class GridRowEventArgs : EventArgs
|
public class GridRowEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
|
|
||||||
private object[] _values;
|
private GridRow _row;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ľąÇ°ĐĐ
|
||||||
|
/// </summary>
|
||||||
|
public GridRow Row
|
||||||
|
{
|
||||||
|
get { return _row; }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 本行各列的值(渲染后的HTML片段)
|
/// 本行各列的值(渲染后的HTML片段)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public object[] Values
|
public object[] Values
|
||||||
{
|
{
|
||||||
get { return _values; }
|
get { return _row.Values; }
|
||||||
set { _values = value; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private object _dataItem;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 行数据源
|
/// 行数据源
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public object DataItem
|
public object DataItem
|
||||||
{
|
{
|
||||||
get { return _dataItem; }
|
get { return _row.DataItem; }
|
||||||
set { _dataItem = value; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private int _rowIndex;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 行索引
|
/// 行索引
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int RowIndex
|
public int RowIndex
|
||||||
{
|
{
|
||||||
get { return _rowIndex; }
|
get { return _row.RowIndex; }
|
||||||
set { _rowIndex = value; }
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ĐĐID
|
||||||
|
/// </summary>
|
||||||
|
public string RowID
|
||||||
|
{
|
||||||
|
get { return _row.RowID; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构造函数
|
/// 构造函数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dataItem">行数据源</param>
|
/// <param name="row">ĐĐ</param>
|
||||||
/// <param name="rowIndex">行索引</param>
|
public GridRowEventArgs(GridRow row)
|
||||||
/// <param name="values">本行各列的值</param>
|
|
||||||
public GridRowEventArgs(object dataItem, int rowIndex, object[] values)
|
|
||||||
{
|
{
|
||||||
_dataItem = dataItem;
|
_row = row;
|
||||||
_values = values;
|
|
||||||
_rowIndex = rowIndex;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -45,16 +45,29 @@ namespace FineUI
|
|||||||
public int RowIndex
|
public int RowIndex
|
||||||
{
|
{
|
||||||
get { return _rowIndex; }
|
get { return _rowIndex; }
|
||||||
set { _rowIndex = value; }
|
//set { _rowIndex = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string _rowID;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ÐÐID
|
||||||
|
/// </summary>
|
||||||
|
public string RowID
|
||||||
|
{
|
||||||
|
get { return _rowID; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构造函数
|
/// 构造函数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="rowIndex">行索引</param>
|
/// <param name="rowIndex">行索引</param>
|
||||||
public GridRowSelectEventArgs(int rowIndex)
|
/// <param name="rowID">ÐÐID</param>
|
||||||
|
public GridRowSelectEventArgs(int rowIndex, string rowID)
|
||||||
{
|
{
|
||||||
_rowIndex = rowIndex;
|
_rowIndex = rowIndex;
|
||||||
|
_rowID = rowID;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,6 @@ namespace FineUI
|
|||||||
public string SortField
|
public string SortField
|
||||||
{
|
{
|
||||||
get { return _sortField; }
|
get { return _sortField; }
|
||||||
set { _sortField = value; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -53,7 +52,6 @@ namespace FineUI
|
|||||||
public string SortDirection
|
public string SortDirection
|
||||||
{
|
{
|
||||||
get { return _sortDirection; }
|
get { return _sortDirection; }
|
||||||
set { _sortDirection = value; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int _columnIndex;
|
private int _columnIndex;
|
||||||
@ -64,21 +62,34 @@ namespace FineUI
|
|||||||
public int ColumnIndex
|
public int ColumnIndex
|
||||||
{
|
{
|
||||||
get { return _columnIndex; }
|
get { return _columnIndex; }
|
||||||
set { _columnIndex = value; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private string _columnID;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 列ID
|
||||||
|
/// </summary>
|
||||||
|
public string ColumnID
|
||||||
|
{
|
||||||
|
get { return _columnID; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构造函数
|
/// 构造函数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sortField">排序字段</param>
|
/// <param name="sortField">排序字段</param>
|
||||||
/// <param name="sortDirection">排序方向</param>
|
/// <param name="sortDirection">排序方向</param>
|
||||||
/// <param name="columnIndex">列索引</param>
|
/// <param name="columnIndex">列索引</param>
|
||||||
public GridSortEventArgs(string sortField, string sortDirection, int columnIndex)
|
/// <param name="columnID">列</param>
|
||||||
|
public GridSortEventArgs(string sortField, string sortDirection, int columnIndex, string columnID)
|
||||||
{
|
{
|
||||||
_sortField = sortField;
|
_sortField = sortField;
|
||||||
_sortDirection = sortDirection;
|
_sortDirection = sortDirection;
|
||||||
_columnIndex = columnIndex;
|
_columnIndex = columnIndex;
|
||||||
|
_columnID = columnID;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -328,7 +328,7 @@ namespace FineUI
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string paramStr = String.Format("Command${0}${1}${2}${3}", row.RowIndex, ColumnIndex, CommandName.Replace("'", "\""), CommandArgument.Replace("'", "\""));
|
string paramStr = String.Format("Command${0}${1}${2}${3}", row.RowID, ColumnID, CommandName.Replace("'", "\""), CommandArgument.Replace("'", "\""));
|
||||||
|
|
||||||
// 延迟执行,确保当前复选框的状态已经改变
|
// 延迟执行,确保当前复选框的状态已经改变
|
||||||
string postBackReference = JsHelper.GetDeferScript(Grid.GetPostBackEventReference(paramStr, EnableAjax), 0);
|
string postBackReference = JsHelper.GetDeferScript(Grid.GetPostBackEventReference(paramStr, EnableAjax), 0);
|
||||||
|
@ -337,7 +337,27 @@ namespace FineUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Unit _minWidth = Unit.Empty;
|
||||||
|
/// <summary>
|
||||||
|
/// ×îСÁпí¶È
|
||||||
|
/// </summary>
|
||||||
|
[Category(CategoryName.OPTIONS)]
|
||||||
|
[DefaultValue(typeof(Unit), "")]
|
||||||
|
[Description("×îСÁпí¶È")]
|
||||||
|
public virtual Unit MinWidth
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _minWidth;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_minWidth = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private int _boxFlex = 0;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 控制子控件的尺寸(表格列使用HBox布局)
|
/// 控制子控件的尺寸(表格列使用HBox布局)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -348,18 +368,16 @@ namespace FineUI
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
object obj = FState["BoxFlex"];
|
return _boxFlex;
|
||||||
return obj == null ? 0 : (int)obj;
|
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
FState["BoxFlex"] = value;
|
_boxFlex = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private bool _expandUnusedSpace = false;
|
private bool _expandUnusedSpace = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 此列会扩展所有未使用的宽度
|
/// 此列会扩展所有未使用的宽度
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -647,6 +665,11 @@ namespace FineUI
|
|||||||
OB.AddProperty("flex", BoxFlex);
|
OB.AddProperty("flex", BoxFlex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (MinWidth != Unit.Empty)
|
||||||
|
{
|
||||||
|
OB.AddProperty("minWidth", MinWidth.Value);
|
||||||
|
}
|
||||||
|
|
||||||
if (ExpandUnusedSpace)
|
if (ExpandUnusedSpace)
|
||||||
{
|
{
|
||||||
OB.AddProperty("flex", 1);
|
OB.AddProperty("flex", 1);
|
||||||
|
@ -598,7 +598,7 @@ namespace FineUI
|
|||||||
nb.SetProperty("href", "javascript:;");
|
nb.SetProperty("href", "javascript:;");
|
||||||
|
|
||||||
// click
|
// click
|
||||||
string paramStr = String.Format("Command${0}${1}${2}${3}", row.RowIndex, ColumnIndex, CommandName.Replace("'", "\""), CommandArgument.Replace("'", "\""));
|
string paramStr = String.Format("Command${0}${1}${2}${3}", row.RowID, ColumnID, CommandName.Replace("'", "\""), CommandArgument.Replace("'", "\""));
|
||||||
string postBackReference = Grid.GetPostBackEventReference(paramStr, EnableAjax);
|
string postBackReference = Grid.GetPostBackEventReference(paramStr, EnableAjax);
|
||||||
|
|
||||||
string clientScript = Button.ResolveClientScript(ValidateForms, ValidateTarget, ValidateMessageBox, EnablePostBack, postBackReference,
|
string clientScript = Button.ResolveClientScript(ValidateForms, ValidateTarget, ValidateMessageBox, EnablePostBack, postBackReference,
|
||||||
|
@ -69,9 +69,78 @@ namespace FineUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 启用本列的单元格编辑功能
|
||||||
|
/// </summary>
|
||||||
|
[Category(CategoryName.OPTIONS)]
|
||||||
|
[DefaultValue(true)]
|
||||||
|
[Description("启用本列的单元格编辑功能")]
|
||||||
|
public virtual bool EnableColumnEdit
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
object obj = FState["EnableColumnEdit"];
|
||||||
|
return obj == null ? true : (bool)obj;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
FState["EnableColumnEdit"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region OnAjaxPreRender
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 渲染 HTML 之前调用(AJAX回发)
|
||||||
|
/// </summary>
|
||||||
|
protected override void OnAjaxPreRender()
|
||||||
|
{
|
||||||
|
// 调用 base.OnAjaxPreRender 方法,这样 Hidden 等属性改变就记录在 GridColumn 中,而无需 Grid 中的AJAX属性 HiddenColumns
|
||||||
|
base.OnAjaxPreRender();
|
||||||
|
|
||||||
|
|
||||||
|
//// 表格列控件监视部分列属性的改变
|
||||||
|
//StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
//if (PropertyModified("EnableColumnEdit"))
|
||||||
|
//{
|
||||||
|
// sb.AppendFormat("{0}.f_setEditable();", XID);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//AddAjaxScript(sb);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//if (sb.Length > 0)
|
||||||
|
//{
|
||||||
|
// // 输出表格的短名称,后面会调用 f_loadData
|
||||||
|
// ResourceManager.Instance.AddAjaxShortName(Grid.ClientID, Grid.XID);
|
||||||
|
|
||||||
|
// // 告诉 ResponseFilter,要调用 f_loadData,因为表格列属性改变了
|
||||||
|
// PageManager.Instance.AddAjaxGridColumnChangedGridClientID(Grid.ClientID);
|
||||||
|
//}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region OnFirstPreRender
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 渲染 HTML 之前调用(页面第一次加载或者普通回发)
|
||||||
|
/// </summary>
|
||||||
|
protected override void OnFirstPreRender()
|
||||||
|
{
|
||||||
|
base.OnFirstPreRender();
|
||||||
|
|
||||||
|
OB.AddProperty("f_editable", EnableColumnEdit);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,18 +85,22 @@ namespace FineUI
|
|||||||
{
|
{
|
||||||
base.OnFirstPreRender();
|
base.OnFirstPreRender();
|
||||||
|
|
||||||
|
OB.AddProperty("f_columnType", "rendercheckfield");
|
||||||
|
|
||||||
|
|
||||||
if (Grid.AllowCellEditing)
|
if (Grid.AllowCellEditing)
|
||||||
{
|
{
|
||||||
OB.AddProperty("xtype", "checkcolumn");
|
OB.AddProperty("xtype", "checkcolumn");
|
||||||
|
|
||||||
if (Grid.EnableAfterEditEvent)
|
if (Grid.EnableAfterEditEvent)
|
||||||
{
|
{
|
||||||
string validateScript = "var args='AfterEdit$'+rowIndex+'$" + ColumnID + "';";
|
string rowIdScript = String.Format("var rowId=F('{0}').getStore().getAt(rowIndex).getId();", Grid.ClientID);
|
||||||
|
string validateScript = "var args='AfterEdit$'+rowId+'$" + ColumnID + "';";
|
||||||
validateScript += Grid.GetPostBackEventReference("#AfterEdit#").Replace("'#AfterEdit#'", "args");
|
validateScript += Grid.GetPostBackEventReference("#AfterEdit#").Replace("'#AfterEdit#'", "args");
|
||||||
|
|
||||||
//string checkchangeScript = String.Format("function(checkcolumn,rowIndex,checked){{{0}}}", validateScript);
|
//string checkchangeScript = String.Format("function(checkcolumn,rowIndex,checked){{{0}}}", validateScript);
|
||||||
//OB.Listeners.AddProperty("checkchange", checkchangeScript, true);
|
//OB.Listeners.AddProperty("checkchange", checkchangeScript, true);
|
||||||
AddListener("checkchange", validateScript, "checkcolumn", "rowIndex", "checked");
|
AddListener("checkchange", rowIdScript + validateScript, "checkcolumn", "rowIndex", "checked");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,6 +222,32 @@ namespace FineUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 启用本列的单元格编辑功能(如果未定义Editor,则此属性为false)
|
||||||
|
/// </summary>
|
||||||
|
[Category(CategoryName.OPTIONS)]
|
||||||
|
[DefaultValue(true)]
|
||||||
|
[Description("启用本列的单元格编辑功能(如果未定义Editor,则此属性为false)")]
|
||||||
|
public override bool EnableColumnEdit
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (Editor.Count > 0)
|
||||||
|
{
|
||||||
|
object obj = FState["EnableColumnEdit"];
|
||||||
|
return obj == null ? true : (bool)obj;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 如果未定义 Editor,则此属性为false
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
FState["EnableColumnEdit"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -253,6 +279,10 @@ namespace FineUI
|
|||||||
{
|
{
|
||||||
result = Convert.ToSingle(value);
|
result = Convert.ToSingle(value);
|
||||||
}
|
}
|
||||||
|
else if (FieldType == FieldType.Double)
|
||||||
|
{
|
||||||
|
result = Convert.ToDouble(value);
|
||||||
|
}
|
||||||
else if (FieldType == FieldType.Date)
|
else if (FieldType == FieldType.Date)
|
||||||
{
|
{
|
||||||
// http://www.dotnetperls.com/datetime-format
|
// http://www.dotnetperls.com/datetime-format
|
||||||
@ -352,6 +382,9 @@ namespace FineUI
|
|||||||
{
|
{
|
||||||
base.OnFirstPreRender();
|
base.OnFirstPreRender();
|
||||||
|
|
||||||
|
OB.AddProperty("f_columnType", "renderfield");
|
||||||
|
|
||||||
|
|
||||||
string renderer = GetRenderer();
|
string renderer = GetRenderer();
|
||||||
if (!String.IsNullOrEmpty(renderer))
|
if (!String.IsNullOrEmpty(renderer))
|
||||||
{
|
{
|
||||||
|
@ -149,6 +149,23 @@ namespace FineUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string _rowID = String.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 此行DataIDField字段的值
|
||||||
|
/// </summary>
|
||||||
|
public string RowID
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _rowID;
|
||||||
|
}
|
||||||
|
internal set
|
||||||
|
{
|
||||||
|
_rowID = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private object[] _states = null;
|
private object[] _states = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -187,29 +204,84 @@ namespace FineUI
|
|||||||
#region ToShortStates/FromShortStates
|
#region ToShortStates/FromShortStates
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 当前行列状态列表
|
/// 是否定义了行列状态列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
internal object[] ToShortStates()
|
internal bool HasStates()
|
||||||
|
{
|
||||||
|
bool defined = false;
|
||||||
|
|
||||||
|
foreach (object state in _states)
|
||||||
|
{
|
||||||
|
if (state != null)
|
||||||
|
{
|
||||||
|
defined = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return defined;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 恢复当前行列状态列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="states"></param>
|
||||||
|
internal void RecoverStates(object[] states)
|
||||||
|
{
|
||||||
|
if (states == null || states.Length == 0)
|
||||||
{
|
{
|
||||||
List<object> shortStates = new List<object>();
|
|
||||||
Collection<GridColumn> columns = _grid.AllColumns;
|
Collection<GridColumn> columns = _grid.AllColumns;
|
||||||
for (int i = 0, count = columns.Count; i < count; i++)
|
_states = new object[columns.Count];
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (columns[i].PersistState)
|
_states = states;
|
||||||
|
|
||||||
|
// 已经更新了当前行的States,下面从States恢复相应单元格的Value,比如CheckBoxField的GetColumnValue就是从States读取的值
|
||||||
|
int columnIndex = 0;
|
||||||
|
foreach (object state in _states)
|
||||||
{
|
{
|
||||||
shortStates.Add(States[i]);
|
if (state != null)
|
||||||
|
{
|
||||||
|
UpdateValuesAt(columnIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
columnIndex++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return shortStates.ToArray();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 当前行列状态列表
|
||||||
|
///// </summary>
|
||||||
|
///// <returns></returns>
|
||||||
|
//internal object[] ToShortStates()
|
||||||
|
//{
|
||||||
|
// List<object> shortStates = new List<object>();
|
||||||
|
// Collection<GridColumn> columns = _grid.AllColumns;
|
||||||
|
// for (int i = 0, count = columns.Count; i < count; i++)
|
||||||
|
// {
|
||||||
|
// if (columns[i].PersistState)
|
||||||
|
// {
|
||||||
|
// shortStates.Add(States[i]);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return shortStates.ToArray();
|
||||||
|
//}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 恢复当前行列状态列表(同时更新相应的Values值)
|
/// 恢复当前行列状态列表(同时更新相应的Values值)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="shortStates"></param>
|
/// <param name="shortStates"></param>
|
||||||
internal void FromShortStates(object[] shortStates)
|
internal void FromShortStates(object[] shortStates)
|
||||||
{
|
{
|
||||||
|
if (shortStates == null || shortStates.Length == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Collection<GridColumn> columns = _grid.AllColumns;
|
Collection<GridColumn> columns = _grid.AllColumns;
|
||||||
States = new object[columns.Count];
|
States = new object[columns.Count];
|
||||||
int shortStateIndex = 0;
|
int shortStateIndex = 0;
|
||||||
@ -328,6 +400,24 @@ namespace FineUI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
internal void DataBindRow()
|
internal void DataBindRow()
|
||||||
{
|
{
|
||||||
|
// DataIDField
|
||||||
|
if (!String.IsNullOrEmpty(Grid.DataIDField))
|
||||||
|
{
|
||||||
|
RowID = GetPropertyValue(Grid.DataIDField).ToString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 如果表格未定义 DataIDField,则自动生成一个 RowId
|
||||||
|
//RowID = GridRowIDManager.Instance.GetNextGridRowID();
|
||||||
|
|
||||||
|
// 如果表格未定义 DataIDField,则自动生成一个 RowId
|
||||||
|
// 使用 rowIndex 来组装 RowId,在页面回发过程中相对比较稳定
|
||||||
|
RowID = String.Format("frow{0}", RowIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach (GridTemplateContainer tplCtrl in TemplateContainers)
|
foreach (GridTemplateContainer tplCtrl in TemplateContainers)
|
||||||
{
|
{
|
||||||
if (tplCtrl != null)
|
if (tplCtrl != null)
|
||||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -29,23 +29,112 @@ FineUI 严格遵守 ExtJS 对开源软件的规定,不再内置 ExtJS 库,
|
|||||||
|
|
||||||
发布历史
|
发布历史
|
||||||
|
|
||||||
|
+2016-01-04 v4.2.3
|
||||||
|
-修正表格后台无法更新选中行的问题(丝路、black_shrimp-7649)。
|
||||||
|
-更新表格控件->模板列->购物车示例,数量输入框只允许输入数字(揣兜-7654)。
|
||||||
|
-官网示例首页树菜单增加提示信息,在NodeDataBound中进行处理。
|
||||||
|
+树控件增强。
|
||||||
|
-树节点增加CssClass属性,增加示例:树控件->杂项->节点样式。
|
||||||
|
-树控件增加EnableTextSelection属性,增加示例:树控件->杂项->启用文字选择。
|
||||||
|
-增加示例:树控件->杂项->同级节点只能展开一个;右键菜单(展开全部子节点)(揣兜-7653)。
|
||||||
|
-增加示例:更多控件->手风琴控件->手风琴(禁用填充)。
|
||||||
|
-修正RenderCheckField的失去焦点事件中得到e.RowIndex=-1的问题(叶子)。
|
||||||
|
-修正在顶层页面弹出EnableIFrame的窗体控件,先关闭父页面后无法关闭弹出窗体的问题(7107135-7683)。
|
||||||
|
-增加示例:更多控件->工具栏和菜单->工具栏布局(左中右)。
|
||||||
|
-增加示例:表格控件->扩展列->行扩展列(嵌套表格)(spring2007-7668)。
|
||||||
|
-修正不同域的IFrame中,在IFrame内弹出窗体时出现拒绝访问的问题。
|
||||||
|
-修正在弹出窗体中使用ASP.NET的原生FileUpload控件时无法关闭窗体的问题(ζั͡ޓއއ人-7767)。
|
||||||
|
-表格增加KeepCurrentSelection属性,增加示例:行选择->行选择(保持选中行)(cubealex、shihahayue-7861)。
|
||||||
|
-修正res.axd导致的安全漏洞(cnblogs.com/dotnet-org-cn/p/5089924.html)。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
+2015-11-09 v4.2.2
|
||||||
|
-官网示例总数突破300个!
|
||||||
|
-更新示例,如果PageManager定义了AutoSizePanelID属性,则去除页面的CSS定义:body.f-body。
|
||||||
|
-修正自定义提示对话框图标无效的问题(莮亾-7615)。
|
||||||
|
-Alert、Confirm增加CssClass属性。更新示例:杂项->消息框->自定义对话框图标。
|
||||||
|
+表格增强。
|
||||||
|
-单元格编辑表格重新绑定数据时,先取消当前活动的编辑器(andyxjy2-7559)。
|
||||||
|
-单元格编辑表格底层传输数据优化(不兼容提醒!),将修改和删除数据合并,由原来的:[[1,0,{"AtSchool":false}]]
|
||||||
|
改为:[{"index":1,"originalIndex":0,"id":"record-3","values":{"AtSchool":false},"status":"modified"}]。
|
||||||
|
-为FieldType增加枚举类型Double(精度为15~16),Float的精度为6~7。
|
||||||
|
+一个函数获取单元格编辑的全部内容(GetMergedData),包含新增、删除、修改的数据。
|
||||||
|
-新增示例:单元格编辑->新增删除->新增行与删除行(GetMergedData)。
|
||||||
|
-表格增加DataIDField属性,GridRow增加RowID属性。
|
||||||
|
-表格服务器事件参数增强,主要是增加RowID属性,并和之前兼容。
|
||||||
|
-将GetDeleteSelectedReference标识为已过时,请使用GetDeleteSelectedRowsReference。
|
||||||
|
+为GetAddNewRecordReference增加重载函数,可以指定增加行后进入编辑状态的列。
|
||||||
|
-增加示例:单元格编辑->新增删除->新增行(定位到某一列)。
|
||||||
|
-增加示例:单元格编辑->结束编辑->结束编辑(姓名不能为空);结束编辑(高亮单元格);结束编辑(更新单元格的值);
|
||||||
|
结束编辑(更新非可编辑单元格的值)。
|
||||||
|
+SelectedCell的数据类型由int[]改为string[](不兼容提醒!)。
|
||||||
|
-更新示例:单元格编辑->新增删除行->服务器端删除行。
|
||||||
|
-增加示例:单元格编辑->结束编辑->结束编辑(绑定数据后选中单元格)。
|
||||||
|
-增加属性SelectedRowIDArray、SelectedRowID。
|
||||||
|
-增加属性EnableRowDeselectEvent,更新示例:事件->行选中事件(取消选中事件)。
|
||||||
|
-表格列增加MinWidth,增加示例:列宽度->自适应列(多列);各列宽度自适应(最小列宽度)。
|
||||||
|
-表格增加EnableColumnResize属性,增加示例:标题栏菜单->隐藏标题栏;禁用表头菜单。
|
||||||
|
+优化导出文件的脚本。
|
||||||
|
-__doPostBack第一个参数指定是否AJAX请求,例如:__doPostBack(false, '', 'Confirm_OK')。
|
||||||
|
-JS变量F.control_enable_ajax更名为F.controlEnableAjax(不兼容提醒!)。
|
||||||
|
-GetCustomEventReference第一个参数指定是否AJAX请求,例如:GetCustomEventReference(false, "Confirm_OK")。
|
||||||
|
-更新示例:杂项->消息框->响应确定按钮(点击确定按钮后,下载文件);响应确定按钮(点击确定按钮后,先隐藏窗体再下载文件);
|
||||||
|
响应确定按钮(点击确定按钮后,先隐藏IFrame窗体再下载文件)。
|
||||||
|
-增加示例:表格控件->导出与下载->导出文件(双击下载);杂项->消息框->自定义对话框按钮文本。
|
||||||
|
+表单增强。
|
||||||
|
-增加配置项:FormRowItemsSpace(表单行子项之间的间距,默认为8px,对应于Form的FormRowItemsSpace属性)。
|
||||||
|
-Form控件重构,FormRow作为面板渲染到客户端,可以显示隐藏。
|
||||||
|
-Form中的表单元素响应Tab键时横向跳转,更加符合用户习惯(之前是纵向跳转)。
|
||||||
|
-更新示例:表单控件->杂项->隐藏表单字段;禁用与只读。
|
||||||
|
-增加示例:表单布局->标签文本水平居中;表单中的多行按钮;
|
||||||
|
-增加示例:杂项->自定义标签宽度和位置;标签换行;ColumnWidths混合使用百分比和固定宽度。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
+2015-10-22 v4.2.1
|
||||||
|
+修正部分IE11下出现的JS错误。
|
||||||
|
-无法获取未定义或null引用的属性 ext-quicktips-tip_header-overflowPadderEl(baolin1389、♂♂LOVE、meng)。
|
||||||
|
+仅对表格内存分页有部分影响(不兼容提醒!)。
|
||||||
|
-表格属性SelectedRowIndex、SelectedRowIndexArray指的是在当前分页中的索引(和之前兼容,无需修改)。
|
||||||
|
+表格所有其他地方的RowIndex指的是在全部数据源中的索引(和之前不兼容,需要注意)。
|
||||||
|
-所有表格事件参数RowIndex属性,包括GridAfterEditEventArgs、GridRowClickEventArgs等。
|
||||||
|
-获取单元格编辑修改值grid1.GetModifiedDict,以及删除的行GetDeletedList。
|
||||||
|
-表格行实例的RowIndex属性。
|
||||||
|
-CheckBoxField的函数GetCheckedState的参数。
|
||||||
|
-增加示例:杂项->拦截服务器端重定向(模拟登陆超时,同步确认对话框);(同步确认对话框)。
|
||||||
|
-客户端函数F.alert、F.confirm参数调整,接受options对象参数。
|
||||||
|
-修正日期控件的星期中文缩写错误的问题(dzvane-7271)。
|
||||||
|
-修正新增的行无法清空的问题(tyarist-7284)。
|
||||||
|
-新增示例:表格控件->单元格编辑->多行文本输入框。
|
||||||
|
-面板标题可以为空字符串。
|
||||||
|
+为面板增加MinHeight、MinWidth、MaxHeight、MaxWidth属性。
|
||||||
|
-增加示例:更多控件->面板与窗体->窗体(限制最小和最大尺寸)。
|
||||||
|
-表单字段增加LabelAlign属性。
|
||||||
|
-增加示例:页面布局->布局(VBox,折叠面板);布局(HBox,横向表单);布局(VBox,表单);
|
||||||
|
布局(VBox,折叠面板);布局(VBox,纵向滚动条);布局(VBox,自动高度);布局(VBox,表单与表格,纵向滚动条);
|
||||||
|
布局(HBox,横向滚动条);布局(HBox,自动高度);布局(HBox,自动高度,多层嵌套);
|
||||||
|
布局(Table,Table布局的表单);布局(Column,纵向滚动条);布局(Column,自动高度)。
|
||||||
|
-启用单元格编辑的表格调用DataBind时会重新加载数据(客户端新增的行也会被清除)。
|
||||||
|
-增加示例:更多控件->面板与窗体->窗体(固定最大化)。
|
||||||
|
-增加示例:更多控件->工具栏和菜单->工具栏上的表单字段。
|
||||||
|
-增加示例:表单控件->下拉列表控件->下拉列表(默认为空);事件->下拉列表(自动回发);
|
||||||
|
下拉列表(自动回发,可编辑,强制选择);下拉列表(不自动回发,定义了回发事件);
|
||||||
|
下拉列表(多选,自动回发,可编辑,强制选择)。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+2015-05-20 v4.2.0
|
+2015-05-20 v4.2.0
|
||||||
-增加示例:其他控件->面板与窗体->同时打开多个窗体。
|
-增加示例:更多控件->面板与窗体->同时打开多个窗体。
|
||||||
-增加示例:第三方组件->jQueryUI Autocomplete->内联数据(位于Window控件中)。
|
-增加示例:第三方组件->jQueryUI Autocomplete->内联数据(位于Window控件中)。
|
||||||
-增加示例:其他控件->工具栏与菜单->工具栏上的图片(固定宽度);工具栏上的图片(动态调整)。
|
-增加示例:更多控件->工具栏与菜单->工具栏上的图片(固定宽度);工具栏上的图片(动态调整)。
|
||||||
-修正删除不存在的选项卡时可能出现的错误(揣兜-7085)。
|
-修正删除不存在的选项卡时可能出现的错误(揣兜-7085)。
|
||||||
+表格增强。
|
+表格增强。
|
||||||
-增加示例:行与列样式->行样式(数据库分页);行样式(内存分页);列样式。
|
-增加示例:行与列样式->行样式(数据库分页);行样式(内存分页);列样式。
|
||||||
-增加示例:序号列->序号列(靠左显示)(dennisliu)。
|
-增加示例:序号列->序号列(靠左显示)(dennisliu)。
|
||||||
-更新示例:杂项->文本居中显示(标题靠左)。
|
-更新示例:杂项->文本居中显示(标题靠左)。
|
||||||
-增加示例:事件->行内按钮事件(内存分页);行内按钮事件(数据库分页)。
|
-增加示例:事件->行内按钮事件(内存分页);行内按钮事件(数据库分页)。
|
||||||
+仅对表格内存分页有部分影响(不兼容提醒!)。
|
|
||||||
-表格属性SelectedRowIndex、SelectedRowIndexArray指的是在当前分页中的索引(和之前兼容,无需修改)。
|
|
||||||
+表格所有其他地方的RowIndex指的是在全部数据源中的索引(和之前不兼容,需要注意)。
|
|
||||||
-所有表格事件参数RowIndex属性,包括GridAfterEditEventArgs、GridRowClickEventArgs等。
|
|
||||||
-获取单元格编辑修改值grid1.GetModifiedData返回的键值。
|
|
||||||
-表格行实例的RowIndex属性。
|
|
||||||
-CheckBoxField的函数GetCheckedState的参数。
|
|
||||||
+修正一直存在的一个隐藏问题。
|
+修正一直存在的一个隐藏问题。
|
||||||
-此问题仅在用户多次快速点击页面上的回发按钮,并且网速比较慢时才可能会出现。
|
-此问题仅在用户多次快速点击页面上的回发按钮,并且网速比较慢时才可能会出现。
|
||||||
-关于如何重现本问题以及内部原因,请搜索论坛 - 验证视图状态MAC失败。
|
-关于如何重现本问题以及内部原因,请搜索论坛 - 验证视图状态MAC失败。
|
||||||
@ -65,11 +154,11 @@ FineUI 严格遵守 ExtJS 对开源软件的规定,不再内置 ExtJS 库,
|
|||||||
-修正下拉列表数据绑定后在第一个位置插入项,而最终选中的非第一项的问题。
|
-修正下拉列表数据绑定后在第一个位置插入项,而最终选中的非第一项的问题。
|
||||||
-修正下拉列表在没有数据项时,可能会触发SelectedIndexChanged事件的问题。
|
-修正下拉列表在没有数据项时,可能会触发SelectedIndexChanged事件的问题。
|
||||||
-BoxLayoutAlign的默认值由Start改为Stretch。
|
-BoxLayoutAlign的默认值由Start改为Stretch。
|
||||||
-增加示例:其他控件->选项卡控件->选项卡的位置。
|
-增加示例:更多控件->选项卡控件->选项卡的位置。
|
||||||
-更新示例:表单控件->杂项->禁用与只读。
|
-更新示例:表单控件->杂项->禁用与只读。
|
||||||
-修正AutoSizePanelID的面板中Submit按钮回车无效的问题(Ward_Lee)。
|
-修正AutoSizePanelID的面板中Submit按钮回车无效的问题(Ward_Lee)。
|
||||||
+支持一个面板拥有多个工具栏。
|
+支持一个面板拥有多个工具栏。
|
||||||
-增加示例:其他控件->工具栏与菜单->多行工具栏。
|
-增加示例:更多控件->工具栏与菜单->多行工具栏。
|
||||||
-增加示例:表格控件->分页与排序->数据库分页(底部工具栏)。
|
-增加示例:表格控件->分页与排序->数据库分页(底部工具栏)。
|
||||||
+重构表单改变确认对话框(不兼容提醒!)。
|
+重构表单改变确认对话框(不兼容提醒!)。
|
||||||
-删除Window控件的EnableConfirmOnClose属性,以及GetConfirmHideReference类似的5个方法。
|
-删除Window控件的EnableConfirmOnClose属性,以及GetConfirmHideReference类似的5个方法。
|
||||||
@ -1512,8 +1601,8 @@ FineUI 严格遵守 ExtJS 对开源软件的规定,不再内置 ExtJS 库,
|
|||||||
|
|
||||||
|
|
||||||
+2008-09-09 v1.1
|
+2008-09-09 v1.1
|
||||||
+Toolbar去除IsPageMenu属性,在网报中可以用自定义样式实现,而不应该写在控件中。
|
+Toolbar去除IsPageMenu属性,可以用自定义样式实现,而不应该写在控件中。
|
||||||
-网报:CssClass="toolbar-pagemenu" CssStyle="border:0px;",同时定义样式:.toolbar-pagemenu{ background: rgb(208, 222, 240) url(../images/pagemenu_toolbar_background.gif) repeat-x left top;}。
|
-CssClass="toolbar-pagemenu" CssStyle="border:0px;",同时定义样式:.toolbar-pagemenu{ background: rgb(208, 222, 240) url(../images/pagemenu_toolbar_background.gif) repeat-x left top;}。
|
||||||
-Region去除默认的Layout=Fit,如果希望Region使用Fit/Anchor/Column/Row等布局的话,需要手工指定。
|
-Region去除默认的Layout=Fit,如果希望Region使用Fit/Anchor/Column/Row等布局的话,需要手工指定。
|
||||||
-ToolbarSeparator/ToolbarFill在Ajax更新Hidden属性的BUG。
|
-ToolbarSeparator/ToolbarFill在Ajax更新Hidden属性的BUG。
|
||||||
+布局整理。
|
+布局整理。
|
||||||
@ -1529,7 +1618,7 @@ FineUI 严格遵守 ExtJS 对开源软件的规定,不再内置 ExtJS 库,
|
|||||||
+大部分的FineUI控件增加Hidden属性(少数几个控件没有此属性:Menu),这样在Ajax时可以显示隐藏控件。
|
+大部分的FineUI控件增加Hidden属性(少数几个控件没有此属性:Menu),这样在Ajax时可以显示隐藏控件。
|
||||||
-注意Visible和Hidden的区别:Visible=false的属性不会渲染到客户端,Hidden=true的控件渲染到客户端但是隐藏。
|
-注意Visible和Hidden的区别:Visible=false的属性不会渲染到客户端,Hidden=true的控件渲染到客户端但是隐藏。
|
||||||
-US的FineUI改造强烈依赖于此属性,这个版本发布后可以继续。
|
-US的FineUI改造强烈依赖于此属性,这个版本发布后可以继续。
|
||||||
-网报中唯一没有用到FineUIAjax的地方就是显示隐藏表单字段,现在也可以使用Ajax了。
|
-唯一没有用到FineUIAjax的地方就是显示隐藏表单字段,现在也可以使用Ajax了。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1549,7 +1638,6 @@ FineUI 严格遵守 ExtJS 对开源软件的规定,不再内置 ExtJS 库,
|
|||||||
-模拟树的DropDownList,在Ajax重新绑定DataSource后,保持项是否可选状态是最新的(页面第一次加载时,即使没有数据也需要设置DataTextField/DataValueField/DataSimulateTreeLevelField/DataEnableSelectField等属性的值,否则Ajax回发时会出错)。
|
-模拟树的DropDownList,在Ajax重新绑定DataSource后,保持项是否可选状态是最新的(页面第一次加载时,即使没有数据也需要设置DataTextField/DataValueField/DataSimulateTreeLevelField/DataEnableSelectField等属性的值,否则Ajax回发时会出错)。
|
||||||
-UserControlConnector导致的Ajax错误,去除UpdatePanelConnector控件(以后不会用AspnetAjax,这个控件已经完成使命)。
|
-UserControlConnector导致的Ajax错误,去除UpdatePanelConnector控件(以后不会用AspnetAjax,这个控件已经完成使命)。
|
||||||
-不要使用Asp.net的控件HiddenField,而是使用FineUI的HiddenField,因为Asp.net的控件在Ajax不会被更新,所以会导致视图状态不一致的错误。
|
-不要使用Asp.net的控件HiddenField,而是使用FineUI的HiddenField,因为Asp.net的控件在Ajax不会被更新,所以会导致视图状态不一致的错误。
|
||||||
-网报Ajax整合基本完成(除了待审批->下一步[审核/归档/出纳]操作,由于需要显示隐藏表单字段,目前Ajax不支持,使用的还是普通的PostBack)。
|
|
||||||
-IE下,RadioButtonList中项如果存在汉字,则会换行的BUG。
|
-IE下,RadioButtonList中项如果存在汉字,则会换行的BUG。
|
||||||
-增加两个Theme[Slate/Black](样式尚需完善)。
|
-增加两个Theme[Slate/Black](样式尚需完善)。
|
||||||
|
|
||||||
@ -1575,7 +1663,7 @@ FineUI 严格遵守 ExtJS 对开源软件的规定,不再内置 ExtJS 库,
|
|||||||
-这个版本Ajax和上个版本(v1.1beta1)在设计思路上有很大区别,同时在速度上会有进一步的提升。
|
-这个版本Ajax和上个版本(v1.1beta1)在设计思路上有很大区别,同时在速度上会有进一步的提升。
|
||||||
-基本思想:安全的Ajax交互,明确Ajax回发时支持控件哪些属性的改变,这将适合90%的应用场景(并且具有极快的反应速度),对于需要UI大改动的可采用常规回发,系统提供控件级别的EnableAjax属性。
|
-基本思想:安全的Ajax交互,明确Ajax回发时支持控件哪些属性的改变,这将适合90%的应用场景(并且具有极快的反应速度),对于需要UI大改动的可采用常规回发,系统提供控件级别的EnableAjax属性。
|
||||||
-整理支持Ajax的控件属性改变列表(所有被支持的属性改变都是安全的、快速的,所有不被支持的属性改变不会对UI起作用,同时是安全的,不会有js错误)。
|
-整理支持Ajax的控件属性改变列表(所有被支持的属性改变都是安全的、快速的,所有不被支持的属性改变不会对UI起作用,同时是安全的,不会有js错误)。
|
||||||
-网报Ajax整合(目前只支持所有的列表页面)(v0.8.1)。
|
-Ajax整合(目前只支持所有的列表页面)(v0.8.1)。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1605,12 +1693,12 @@ FineUI 严格遵守 ExtJS 对开源软件的规定,不再内置 ExtJS 库,
|
|||||||
-主要是父页面加载一个比较大的css文件(~100k),则每次打开iframe页面,onload事件的调用都会有500ms左右的延迟,在测试IE性能时要禁用此插件。
|
-主要是父页面加载一个比较大的css文件(~100k),则每次打开iframe页面,onload事件的调用都会有500ms左右的延迟,在测试IE性能时要禁用此插件。
|
||||||
+优化弹出窗口中IFrame的显示速度。
|
+优化弹出窗口中IFrame的显示速度。
|
||||||
-在当前页面弹出窗口需要~20ms,在父页面弹出窗口需要100~300ms。通过缓存弹出的窗口实例,从而第二次弹出窗口不再需要创建时间。
|
-在当前页面弹出窗口需要~20ms,在父页面弹出窗口需要100~300ms。通过缓存弹出的窗口实例,从而第二次弹出窗口不再需要创建时间。
|
||||||
-PageLayout的Region增加SplitColor属性,默认的背景色是透明的。(在网报中需要设置SplitColor="#CADDF7",以便分隔符的颜色和Toolbar的颜色一致)
|
-PageLayout的Region增加SplitColor属性,默认的背景色是透明的。
|
||||||
+PageManager增加属性Theme、Language、FormMessageTarget、FormOffsetRight等属性,这些属性可以在Web.config中设置(推荐方法),也可以为每个页面设置。
|
+PageManager增加属性Theme、Language、FormMessageTarget、FormOffsetRight等属性,这些属性可以在Web.config中设置(推荐方法),也可以为每个页面设置。
|
||||||
-一个典型的应用是为每个用户设置不同的皮肤(根据用户浏览器中Cookie设置的值)(示例在default.aspx)。
|
-一个典型的应用是为每个用户设置不同的皮肤(根据用户浏览器中Cookie设置的值)(示例在default.aspx)。
|
||||||
-TreeNode增加属性SingleClickExpand,表示点击可切换节点的折叠展开状态。
|
-TreeNode增加属性SingleClickExpand,表示点击可切换节点的折叠展开状态。
|
||||||
+TabStrip中非当前Tab会延迟渲染。
|
+TabStrip中非当前Tab会延迟渲染。
|
||||||
-这会明显加快页面的渲染速度,网报中一个典型的费用审批页面可以减少200ms的渲染时间。
|
-这会明显加快页面的渲染速度,一个典型的费用审批页面可以减少200ms的渲染时间。
|
||||||
-由于非当前Tab不会在页面加载时渲染,所以那些Tab中的节点在页面加载后也是不可见的,需要将相关的脚本移动到控件的render事件中。
|
-由于非当前Tab不会在页面加载时渲染,所以那些Tab中的节点在页面加载后也是不可见的,需要将相关的脚本移动到控件的render事件中。
|
||||||
-不能比较两个DataPicker大小的BUG。
|
-不能比较两个DataPicker大小的BUG。
|
||||||
-TabStrip延迟加载引起的BUG(非当前Tab中的ContentPanel会占据页面空间,已修正)。
|
-TabStrip延迟加载引起的BUG(非当前Tab中的ContentPanel会占据页面空间,已修正)。
|
||||||
@ -1669,7 +1757,7 @@ FineUI 严格遵守 ExtJS 对开源软件的规定,不再内置 ExtJS 库,
|
|||||||
-TabStrip延时加载出错。
|
-TabStrip延时加载出错。
|
||||||
-Window的IFrameUrl处理的BUG,比如Pages_FineUI目录下的页面应该为./FE_ApplyEditor.aspx或~/Pages_FineUI/FE_ApplyEditor.aspx。
|
-Window的IFrameUrl处理的BUG,比如Pages_FineUI目录下的页面应该为./FE_ApplyEditor.aspx或~/Pages_FineUI/FE_ApplyEditor.aspx。
|
||||||
-Window的WindowPosition="Center"并且Target="_parent",则会JS错误。
|
-Window的WindowPosition="Center"并且Target="_parent",则会JS错误。
|
||||||
-实现网报首页下拉菜单和左侧菜单的导航功能。
|
-实现首页下拉菜单和左侧菜单的导航功能。
|
||||||
-Window的创建在页面显示后进行,不计算在js渲染时间内。
|
-Window的创建在页面显示后进行,不计算在js渲染时间内。
|
||||||
-优化费用申请页面(尽量减少不必要的层次嵌套)。
|
-优化费用申请页面(尽量减少不必要的层次嵌套)。
|
||||||
-button_iframe.aspx默认会加载form.aspx页面(Window控件的BUG)。
|
-button_iframe.aspx默认会加载form.aspx页面(Window控件的BUG)。
|
||||||
@ -1689,7 +1777,7 @@ FineUI 严格遵守 ExtJS 对开源软件的规定,不再内置 ExtJS 库,
|
|||||||
-一种解决方法是将向页面注册脚本的函数移动到if语句的外面,即每次都向页面注册此脚本。
|
-一种解决方法是将向页面注册脚本的函数移动到if语句的外面,即每次都向页面注册此脚本。
|
||||||
-另一种办法就是在PageManager控件中增加RegisterPageStateChangedScript(向页面注册监视页面中表单内容改变的脚本)的属性(会在每次页面回发(包含ajax回发)时注册脚本)(示例在button_iframe.aspx/simpleform.aspx)。
|
-另一种办法就是在PageManager控件中增加RegisterPageStateChangedScript(向页面注册监视页面中表单内容改变的脚本)的属性(会在每次页面回发(包含ajax回发)时注册脚本)(示例在button_iframe.aspx/simpleform.aspx)。
|
||||||
+PageManager控件增加ExecuteOnReadyWhenPostBack属性(示例在onreadyscript.aspx)。
|
+PageManager控件增加ExecuteOnReadyWhenPostBack属性(示例在onreadyscript.aspx)。
|
||||||
-这个手工添加onReady函数能够在每次页面回发时都注册脚本(包括Ajax局部回发),这就避免了手工去做的麻烦(已经在网报中遇到这种情况)。
|
-这个手工添加onReady函数能够在每次页面回发时都注册脚本(包括Ajax局部回发),这就避免了手工去做的麻烦。
|
||||||
-每个页面必须添加一个PageManager控件,否则会出错,同时去除DesignTimeStyle控件(作为PageManager的属性出现)。
|
-每个页面必须添加一个PageManager控件,否则会出错,同时去除DesignTimeStyle控件(作为PageManager的属性出现)。
|
||||||
-TextField等表单字段增加Readonly属性。
|
-TextField等表单字段增加Readonly属性。
|
||||||
+全新设计的IFrame的架构(尽可能和基于MasterPage的架构保持兼容,和Asp.net Ajax保持兼容)。
|
+全新设计的IFrame的架构(尽可能和基于MasterPage的架构保持兼容,和Asp.net Ajax保持兼容)。
|
||||||
@ -2027,7 +2115,7 @@ FineUI 严格遵守 ExtJS 对开源软件的规定,不再内置 ExtJS 库,
|
|||||||
-如果DataSource是对象的集合,则支持复合对象,也即时可以绑定到UserInfo.UserName的形式(示例在grid_complex.aspx)[zgjiang2]。
|
-如果DataSource是对象的集合,则支持复合对象,也即时可以绑定到UserInfo.UserName的形式(示例在grid_complex.aspx)[zgjiang2]。
|
||||||
-如果Grid放在Panel中,则WindowField不起作用,已经修正 [zgjiang2&jima]。
|
-如果Grid放在Panel中,则WindowField不起作用,已经修正 [zgjiang2&jima]。
|
||||||
-ToolBar内的Button不能设置Visible=false的BUG(同时容器控件中的子控件也面临同样BUG,并修正)[zgjiang2]。
|
-ToolBar内的Button不能设置Visible=false的BUG(同时容器控件中的子控件也面临同样BUG,并修正)[zgjiang2]。
|
||||||
-Panel中只放置一个Toolbar,不放其他控件时会出错,已经修正 [zgjiang2]。
|
-Panel中只放置一个Toolbar,不放更多控件时会出错,已经修正 [zgjiang2]。
|
||||||
+DropDownList完善。
|
+DropDownList完善。
|
||||||
-和Grid的DataSource一样,DataTextField/DataValueField也支持复合对象的绑定。
|
-和Grid的DataSource一样,DataTextField/DataValueField也支持复合对象的绑定。
|
||||||
-自动回发的事件被激发两次 [zgjiang2]。
|
-自动回发的事件被激发两次 [zgjiang2]。
|
||||||
|
Loading…
x
Reference in New Issue
Block a user