v4.2.3
This commit is contained in:
parent
b08eee140a
commit
79ad9e6bc2
File diff suppressed because it is too large
Load Diff
@ -26,10 +26,7 @@
|
||||
<appSettings />
|
||||
<connectionStrings />
|
||||
<system.web>
|
||||
<!-- Net3.5以上的项目,一定要为pages节点加上这两个属性:
|
||||
controlRenderingCompatibilityVersion="3.5"
|
||||
clientIDMode="AutoID"
|
||||
-->
|
||||
<!-- Net4.0以上的项目,一定要为pages节点加上这两个属性:controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID" -->
|
||||
<pages>
|
||||
<controls>
|
||||
<add assembly="FineUI" namespace="FineUI" tagPrefix="f" />
|
||||
@ -41,15 +38,17 @@
|
||||
<httpHandlers>
|
||||
<add verb="GET" path="res.axd" type="FineUI.ResourceHandler, FineUI" validate="false" />
|
||||
</httpHandlers>
|
||||
<httpRuntime maxRequestLength="102400 " />
|
||||
|
||||
<!-- 请求正文的最大值: 512000K = 500M -->
|
||||
<httpRuntime maxRequestLength="512000" />
|
||||
<customErrors mode="Off" />
|
||||
<compilation debug="true" />
|
||||
|
||||
<!--
|
||||
在虚拟主机中运行ASP.NET程序,要添加如下配置项,否则在页面回发时可能出现“验证视图状态 MAC 失败”的错误。
|
||||
如何生成MachineKey:http://blogs.msdn.com/b/amb/archive/2012/07/31/easiest-way-to-generate-machinekey.aspx
|
||||
-->
|
||||
<machineKey decryptionKey="C955D0B041D3749FB4E150677F827DC1857B909399A5D152,IsolateApps" validationKey="891194EEC95A3895658E397FEA04F6187CFAF77151BE89F207D993BB4BA9DE4152BACB05BC4AEB8BBB5FDD950F77881204F59F3F5DBE39FC3EC49119EA7C106D,IsolateApps" />
|
||||
-->
|
||||
|
||||
<!--
|
||||
<authentication mode="Forms">
|
||||
@ -70,7 +69,9 @@
|
||||
</system.web>
|
||||
</location>
|
||||
-->
|
||||
<!-- IIS7 Integrated Mode
|
||||
|
||||
<!-- 集成的托管管道模式下,请添加 system.webServer -->
|
||||
<!--
|
||||
<system.webServer>
|
||||
<modules>
|
||||
<add name="FineUIScriptModule" type="FineUI.ScriptModule, FineUI"/>
|
||||
@ -78,8 +79,6 @@
|
||||
<handlers>
|
||||
<add name="FineUIResourceHandler" verb="GET" path="res.axd" type="FineUI.ResourceHandler, FineUI" validate="false"/>
|
||||
</handlers>
|
||||
<httpErrors errorMode="Detailed"/>
|
||||
<asp scriptErrorSentToBrowser="true"/>
|
||||
</system.webServer>
|
||||
-->
|
||||
</configuration>
|
||||
|
84
FineUI.Examples/Web.config_for_VS2013
Normal file
84
FineUI.Examples/Web.config_for_VS2013
Normal file
@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<section name="FineUI" type="FineUI.ConfigSection, FineUI" requirePermission="false" />
|
||||
</configSections>
|
||||
<!-- 可用的配置项(这里列的都是默认值):
|
||||
Theme="Default"
|
||||
Language="zh_CN"
|
||||
DebugMode="false"
|
||||
FormMessageTarget="Qtip"
|
||||
FormOffsetRight="0"
|
||||
FormLabelWidth="100"
|
||||
FormLabelSeparator=":"
|
||||
FormLabelAlign="Left"
|
||||
FormRedStarPosition="AfterText"
|
||||
EnableAjax="true"
|
||||
EnableAjaxLoading="true"
|
||||
AjaxTimeout="120"
|
||||
AjaxLoadingType="Default"
|
||||
AjaxLoadingText=""
|
||||
ShowAjaxLoadingMaskText=false
|
||||
AjaxLoadingMaskText=""
|
||||
CustomTheme=""
|
||||
CustomThemeBasePath="~/res/themes"
|
||||
IconBasePath="~/res/icon"
|
||||
JSBasePath="~/res/js"
|
||||
IEEdge="true"
|
||||
EnableShim="false"
|
||||
EnableCompactMode="false"
|
||||
-->
|
||||
<FineUI DebugMode="true" Theme="Cupertino" />
|
||||
<appSettings />
|
||||
<connectionStrings />
|
||||
<system.web>
|
||||
<!-- Net4.0以上的项目,一定要为pages节点加上这两个属性:controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID" -->
|
||||
<pages>
|
||||
<controls>
|
||||
<add assembly="FineUI" namespace="FineUI" tagPrefix="f" />
|
||||
</controls>
|
||||
</pages>
|
||||
|
||||
<!-- 请求正文的最大值: 512000K = 500M -->
|
||||
<httpRuntime maxRequestLength="512000" />
|
||||
<customErrors mode="Off" />
|
||||
<compilation debug="true" />
|
||||
|
||||
<!--
|
||||
在虚拟主机中运行ASP.NET程序,要添加如下配置项,否则在页面回发时可能出现“验证视图状态 MAC 失败”的错误。
|
||||
如何生成MachineKey:http://blogs.msdn.com/b/amb/archive/2012/07/31/easiest-way-to-generate-machinekey.aspx
|
||||
|
||||
<machineKey decryptionKey="7E2D92E82700F80C72AA0F6FBE42CCDB76A9A29805355115,IsolateApps" validationKey="40C295F1C6E7332867DD50EBAD174E3A5EF52212070B15519FAB47C00B9EEFA18F24643EFB59FC10946F75CE2EF2DB2D6437BA23CF55A1E358FA32FB25DFFE74,IsolateApps" />
|
||||
-->
|
||||
|
||||
|
||||
<!--
|
||||
<authentication mode="Forms">
|
||||
<forms name=".ASPXFORMSAUTH" loginUrl="~/default.aspx" timeout="120" defaultUrl="~/main.aspx" protection="All" path="/"/>
|
||||
</authentication>
|
||||
<authorization>
|
||||
<deny users="?"/>
|
||||
</authorization>
|
||||
-->
|
||||
|
||||
</system.web>
|
||||
<!--
|
||||
<location path="res.axd">
|
||||
<system.web>
|
||||
<authorization>
|
||||
<allow users ="*" />
|
||||
</authorization>
|
||||
</system.web>
|
||||
</location>
|
||||
-->
|
||||
|
||||
<system.webServer>
|
||||
<modules>
|
||||
<add name="FineUIScriptModule" type="FineUI.ScriptModule, FineUI"/>
|
||||
</modules>
|
||||
<handlers>
|
||||
<add name="FineUIResourceHandler" verb="GET" path="res.axd" type="FineUI.ResourceHandler, FineUI"/>
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
|
||||
</configuration>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -8,119 +8,7 @@
|
||||
<meta name="Title" content="基于 ExtJS 的开源 ASP.NET 控件库(ExtJS based open source ASP.NET Controls)" />
|
||||
<meta name="Description" content="FineUI 的使命是创建 No JavaScript,No CSS,No UpdatePanel,No ViewState,No WebServices 的网站应用程序" />
|
||||
<meta name="Keywords" content="开源,ASP.NET,控件库,ExtJS,AJAX,Web2.0" />
|
||||
<style>
|
||||
#header {
|
||||
position: relative;
|
||||
padding: 10px 10px 8px;
|
||||
}
|
||||
|
||||
#header a.logo {
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
#header a.title {
|
||||
font-weight: bold;
|
||||
font-size: 24px;
|
||||
text-decoration: none;
|
||||
line-height: 36px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
#header .themeroller {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
#header .themeroller a {
|
||||
font-size: 20px;
|
||||
text-decoration: none;
|
||||
line-height: 36px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
#logo {
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
right: 0;
|
||||
filter: alpha(opacity=80);
|
||||
-moz-opacity: 0.8;
|
||||
opacity: 0.8;
|
||||
z-index: 100000;
|
||||
}
|
||||
|
||||
.isnew {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.bottomtable {
|
||||
width: 100%;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/* 修正选项卡标题中放置红色[New!]时,底部出现的一行空白线 */
|
||||
.f-theme-neptune .x-tab .x-tab-inner {
|
||||
line-height: 16px !important;
|
||||
}
|
||||
|
||||
|
||||
/* 主题相关样式 - neptune */
|
||||
.f-theme-neptune #header,
|
||||
.f-theme-neptune .bottomtable,
|
||||
.f-theme-neptune .x-splitter {
|
||||
background-color: #1475BB;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.f-theme-neptune #header a,
|
||||
.f-theme-neptune .bottomtable a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
/* 主题相关样式 - blue */
|
||||
.f-theme-blue #header,
|
||||
.f-theme-blue .bottomtable {
|
||||
background-color: #DFE8F6;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.f-theme-blue #header a,
|
||||
.f-theme-blue .bottomtable a {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/* 主题相关样式 - gray */
|
||||
.f-theme-gray #header,
|
||||
.f-theme-gray .bottomtable {
|
||||
background-color: #E0E0E0;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.f-theme-gray #header a,
|
||||
.f-theme-gray .bottomtable a {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/* 主题相关样式 - access */
|
||||
.f-theme-access #header,
|
||||
.f-theme-access .bottomtable {
|
||||
background-color: #3F4757;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.f-theme-access #header a,
|
||||
.f-theme-access .bottomtable a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.f-theme-access .maincontent .x-panel-body {
|
||||
background-image: none;
|
||||
}
|
||||
</style>
|
||||
<link type="text/css" rel="stylesheet" href="~/res/css/default.css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
@ -230,7 +118,7 @@
|
||||
<tr>
|
||||
<td style="width: 300px;"> 版本:<a target="_blank" href="http://fineui.com/version">v<asp:Literal runat="server" ID="litVersion"></asp:Literal></a>
|
||||
<a target="_blank" href="http://wp.qq.com/wpa/qunwpa?idkey=5a98eb42b742a1edaf22826648d5f61bc16ed08e0253976bc8d30f97508c09c7">QQ公开群</a></td>
|
||||
<td style="text-align: center;">Copyright © 2014 合肥三生石上软件有限公司</td>
|
||||
<td style="text-align: center;">Copyright © 2008-2015 合肥三生石上软件有限公司</td>
|
||||
<td style="width: 300px; text-align: right;">在线人数:<asp:Literal runat="server" ID="litOnlineUserCount"></asp:Literal> </td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -256,6 +144,18 @@
|
||||
</f:MenuCheckBox>
|
||||
<f:MenuSeparator ID="MenuSeparator1" runat="server">
|
||||
</f:MenuSeparator>
|
||||
<f:MenuButton ID="MenuTheme" EnablePostBack="false" Text="主题" runat="server">
|
||||
<Menu ID="Menu4" runat="server">
|
||||
<f:MenuCheckBox Text="Neptune" ID="MenuThemeNeptune" Checked="true" GroupName="MenuTheme" runat="server">
|
||||
</f:MenuCheckBox>
|
||||
<f:MenuCheckBox Text="Blue" ID="MenuThemeBlue" GroupName="MenuTheme" runat="server">
|
||||
</f:MenuCheckBox>
|
||||
<f:MenuCheckBox Text="Gray" ID="MenuThemeGray" GroupName="MenuTheme" runat="server">
|
||||
</f:MenuCheckBox>
|
||||
<f:MenuCheckBox Text="Access" ID="MenuThemeAccess" GroupName="MenuTheme" runat="server">
|
||||
</f:MenuCheckBox>
|
||||
</Menu>
|
||||
</f:MenuButton>
|
||||
<f:MenuButton EnablePostBack="false" Text="菜单样式" ID="MenuStyle" runat="server">
|
||||
<Menu runat="server">
|
||||
<f:MenuCheckBox Text="树菜单" ID="MenuStyleTree" Checked="true" GroupName="MenuStyle" runat="server">
|
||||
@ -274,18 +174,6 @@
|
||||
</f:MenuCheckBox>
|
||||
</Menu>
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="MenuTheme" EnablePostBack="false" Text="主题" runat="server">
|
||||
<Menu ID="Menu4" runat="server">
|
||||
<f:MenuCheckBox Text="Neptune" ID="MenuThemeNeptune" Checked="true" GroupName="MenuTheme" runat="server">
|
||||
</f:MenuCheckBox>
|
||||
<f:MenuCheckBox Text="Blue" ID="MenuThemeBlue" GroupName="MenuTheme" runat="server">
|
||||
</f:MenuCheckBox>
|
||||
<f:MenuCheckBox Text="Gray" ID="MenuThemeGray" GroupName="MenuTheme" runat="server">
|
||||
</f:MenuCheckBox>
|
||||
<f:MenuCheckBox Text="Access" ID="MenuThemeAccess" GroupName="MenuTheme" runat="server">
|
||||
</f:MenuCheckBox>
|
||||
</Menu>
|
||||
</f:MenuButton>
|
||||
<f:MenuSeparator ID="MenuSeparator2" runat="server">
|
||||
</f:MenuSeparator>
|
||||
<f:MenuHyperLink ID="MenuHyperLink2" runat="server" Text="转到 v3.x 中文示例" NavigateUrl="http://fineui.com/demo_v3/" Target="_blank">
|
||||
@ -510,6 +398,7 @@
|
||||
|
||||
|
||||
|
||||
// 此函数源代码定义在:extjs_builder\js\F\F.util.js
|
||||
// 初始化主框架中的树(或者Accordion+Tree)和选项卡互动,以及地址栏的更新
|
||||
// treeMenu: 主框架中的树控件实例,或者内嵌树控件的手风琴控件实例
|
||||
// mainTabStrip: 选项卡实例
|
||||
@ -517,7 +406,7 @@
|
||||
// updateLocationHash: 切换Tab时,是否更新地址栏Hash值
|
||||
// refreshWhenExist: 添加选项卡时,如果选项卡已经存在,是否刷新内部IFrame
|
||||
// refreshWhenTabChange: 切换选项卡时,是否刷新内部IFrame
|
||||
F.util.initTreeTabStrip(mainMenu, mainTabStrip, createToolbar, true, false, false);
|
||||
F.initTreeTabStrip(mainMenu, mainTabStrip, createToolbar, true, false, false);
|
||||
|
||||
|
||||
|
||||
@ -541,7 +430,9 @@
|
||||
};
|
||||
|
||||
|
||||
|
||||
// 添加工具图标,并在点击时显示上下文菜单
|
||||
// 专业版提醒:请将 type:'gear' 改为 iconFont:'gear'
|
||||
leftPanel.addTool({
|
||||
type: 'gear',
|
||||
//tooltip: '系统设置',
|
||||
|
@ -200,12 +200,21 @@ namespace FineUI.Examples
|
||||
/// <param name="e"></param>
|
||||
private void treeMenu_NodeDataBound(object sender, TreeNodeEventArgs e)
|
||||
{
|
||||
// 是否叶子节点
|
||||
bool isLeaf = e.XmlNode.ChildNodes.Count == 0;
|
||||
|
||||
string isNewHtml = GetIsNewHtml(e.XmlNode);
|
||||
if (!String.IsNullOrEmpty(isNewHtml))
|
||||
{
|
||||
e.Node.Text += isNewHtml;
|
||||
}
|
||||
|
||||
if (isLeaf)
|
||||
{
|
||||
// 设置节点的提示信息
|
||||
e.Node.ToolTip = e.Node.Text;
|
||||
}
|
||||
|
||||
// 如果仅显示最新示例 并且 当前节点不是子节点,则展开当前节点
|
||||
if (_showOnlyNew && !e.Node.Leaf)
|
||||
{
|
||||
|
90
FineUI.Examples/default.aspx.designer.cs
generated
90
FineUI.Examples/default.aspx.designer.cs
generated
@ -201,6 +201,51 @@ namespace FineUI.Examples {
|
||||
/// </remarks>
|
||||
protected global::FineUI.MenuSeparator MenuSeparator1;
|
||||
|
||||
/// <summary>
|
||||
/// MenuTheme 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.MenuButton MenuTheme;
|
||||
|
||||
/// <summary>
|
||||
/// MenuThemeNeptune 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.MenuCheckBox MenuThemeNeptune;
|
||||
|
||||
/// <summary>
|
||||
/// MenuThemeBlue 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.MenuCheckBox MenuThemeBlue;
|
||||
|
||||
/// <summary>
|
||||
/// MenuThemeGray 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.MenuCheckBox MenuThemeGray;
|
||||
|
||||
/// <summary>
|
||||
/// MenuThemeAccess 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.MenuCheckBox MenuThemeAccess;
|
||||
|
||||
/// <summary>
|
||||
/// MenuStyle 控件。
|
||||
/// </summary>
|
||||
@ -264,51 +309,6 @@ namespace FineUI.Examples {
|
||||
/// </remarks>
|
||||
protected global::FineUI.MenuCheckBox MenuLangEN;
|
||||
|
||||
/// <summary>
|
||||
/// MenuTheme 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.MenuButton MenuTheme;
|
||||
|
||||
/// <summary>
|
||||
/// MenuThemeNeptune 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.MenuCheckBox MenuThemeNeptune;
|
||||
|
||||
/// <summary>
|
||||
/// MenuThemeBlue 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.MenuCheckBox MenuThemeBlue;
|
||||
|
||||
/// <summary>
|
||||
/// MenuThemeGray 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.MenuCheckBox MenuThemeGray;
|
||||
|
||||
/// <summary>
|
||||
/// MenuThemeAccess 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.MenuCheckBox MenuThemeAccess;
|
||||
|
||||
/// <summary>
|
||||
/// MenuSeparator2 控件。
|
||||
/// </summary>
|
||||
|
@ -1,6 +1,9 @@
|
||||
|
||||
(function () {
|
||||
|
||||
// 正在进行中的AJAX请求个数
|
||||
var __ajaxUnderwayCount = 0;
|
||||
|
||||
F.ajax = {
|
||||
|
||||
timeoutErrorMsg: "Request timeout, please refresh the page and try again!",
|
||||
@ -16,24 +19,24 @@
|
||||
};
|
||||
|
||||
function enableAjax() {
|
||||
if (typeof (F.control_enable_ajax) === 'undefined') {
|
||||
return F.global_enable_ajax;
|
||||
if (typeof (F.controlEnableAjax) === 'undefined') {
|
||||
return F.enableAjax;
|
||||
}
|
||||
return F.control_enable_ajax;
|
||||
return F.controlEnableAjax;
|
||||
}
|
||||
|
||||
function enableAjaxLoading() {
|
||||
if (typeof (F.control_enable_ajax_loading) === 'undefined') {
|
||||
return F.global_enable_ajax_loading;
|
||||
if (typeof (F.controlEnableAjaxLoading) === 'undefined') {
|
||||
return F.enableAjaxLoading;
|
||||
}
|
||||
return F.control_enable_ajax_loading;
|
||||
return F.controlEnableAjaxLoading;
|
||||
}
|
||||
|
||||
function ajaxLoadingType() {
|
||||
if (typeof (F.control_ajax_loading_type) === 'undefined') {
|
||||
return F.global_ajax_loading_type;
|
||||
if (typeof (F.controlAjaxLoadingType) === 'undefined') {
|
||||
return F.ajaxLoadingType;
|
||||
}
|
||||
return F.control_ajax_loading_type;
|
||||
return F.controlAjaxLoadingType;
|
||||
}
|
||||
|
||||
|
||||
@ -41,28 +44,12 @@
|
||||
//if (typeof (F.util.beforeAjaxPostBackScript) === 'function') {
|
||||
// F.util.beforeAjaxPostBackScript();
|
||||
//}
|
||||
F.util.triggerBeforeAjax();
|
||||
|
||||
// 如果显式返回false,则阻止AJAX回发
|
||||
if(F.util.triggerBeforeAjax() === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
function ajaxSuccess(data, viewStateBeforeAJAX) {
|
||||
/*
|
||||
try {
|
||||
new Function(data)();
|
||||
} catch (e) {
|
||||
createErrorWindow({
|
||||
statusText: "Execute JavaScript Exception",
|
||||
status: -1,
|
||||
responseText: util.htmlEncode(data)
|
||||
});
|
||||
}
|
||||
*/
|
||||
new Function('__VIEWSTATE', data)(viewStateBeforeAJAX);
|
||||
|
||||
// 有可能响应返回后即关闭本窗体
|
||||
if (F && F.util) {
|
||||
F.util.triggerAjaxReady();
|
||||
}
|
||||
}
|
||||
|
||||
// Ext.encode will convert Chinese characters. Ext.encode({a:"你好"}) => '{"a":"\u4f60\u597d"}'
|
||||
// We will include the official JSON object from http://json.org/
|
||||
@ -79,13 +66,13 @@
|
||||
F.util.setHiddenFieldValue('F_STATE', fstate);
|
||||
//F.util.setHiddenFieldValue('F_STATE', encodeURIComponent(Ext.encode(getFState())));
|
||||
if (!enableAjax()) {
|
||||
// 当前请求结束后必须重置 F.control_enable_ajax
|
||||
F.control_enable_ajax = undefined;
|
||||
// 当前请求结束后必须重置 F.controlEnableAjax
|
||||
F.controlEnableAjax = undefined;
|
||||
F.util.setHiddenFieldValue('F_AJAX', 'false');
|
||||
theForm.submit();
|
||||
} else {
|
||||
// 当前请求结束后必须重置 F.control_enable_ajax
|
||||
F.control_enable_ajax = undefined;
|
||||
// 当前请求结束后必须重置 F.controlEnableAjax
|
||||
F.controlEnableAjax = undefined;
|
||||
F.util.setHiddenFieldValue('F_AJAX', 'true');
|
||||
var url = document.location.href;
|
||||
var urlHashIndex = url.indexOf('#');
|
||||
@ -94,17 +81,72 @@
|
||||
}
|
||||
|
||||
var viewStateBeforeAJAX = F.util.getHiddenFieldValue('__VIEWSTATE');
|
||||
var disabledButtonIdBeforeAJAX = F.getHidden('F_TARGET');
|
||||
|
||||
function ajaxSuccess(data, viewStateBeforeAJAX) {
|
||||
/*
|
||||
try {
|
||||
new Function(data)();
|
||||
} catch (e) {
|
||||
createErrorWindow({
|
||||
statusText: "Execute JavaScript Exception",
|
||||
status: -1,
|
||||
responseText: util.htmlEncode(data)
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
function processEnd() {
|
||||
// 启用AJAX发起时禁用的按钮
|
||||
if (disabledButtonIdBeforeAJAX) {
|
||||
F.enable(disabledButtonIdBeforeAJAX);
|
||||
}
|
||||
|
||||
//隐藏正在加载提示
|
||||
ajaxStop();
|
||||
}
|
||||
|
||||
|
||||
// 如果显式返回false,则阻止AJAX回发
|
||||
if (F.util.triggerBeforeAjaxSuccess(data) === false) {
|
||||
processEnd();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
new Function('__VIEWSTATE', data)(viewStateBeforeAJAX);
|
||||
|
||||
// 有可能响应返回后即关闭本窗体
|
||||
if (F && F.util) {
|
||||
F.util.triggerAjaxReady();
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
// 重新抛出异常
|
||||
throw e;
|
||||
|
||||
} finally {
|
||||
|
||||
processEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ajaxStart();
|
||||
|
||||
|
||||
// 判断是否有文件上传
|
||||
var isFileUpload = !!Ext.get(theForm).query('input[type=file]').length;
|
||||
|
||||
Ext.Ajax.request({
|
||||
form: theForm.id,
|
||||
url: url,
|
||||
isUpload: F.form_upload_file,
|
||||
isUpload: isFileUpload, //F.form_upload_file,
|
||||
//params: serializeForm(theForm) + '&X_AJAX=true',
|
||||
success: function (data) {
|
||||
var scripts = data.responseText;
|
||||
|
||||
|
||||
if (scripts && F.form_upload_file) {
|
||||
if (scripts && isFileUpload) {
|
||||
// 文件上传时,输出内容经过encodeURIComponent编码(在ResponseFilter中的Close函数中)
|
||||
//scripts = scripts.replace(/<\/?pre[^>]*>/ig, '');
|
||||
scripts = decodeURIComponent(scripts);
|
||||
@ -132,12 +174,12 @@
|
||||
F.util.triggerAjaxReady();
|
||||
}
|
||||
*/
|
||||
}, 100);
|
||||
}, 0);
|
||||
},
|
||||
failure: function (data) {
|
||||
var lastDisabledButtonId = F.util.getHiddenFieldValue('F_TARGET');
|
||||
if (lastDisabledButtonId) {
|
||||
F.enable(lastDisabledButtonId);
|
||||
//var lastDisabledButtonId = F.util.getHiddenFieldValue('F_TARGET');
|
||||
if (disabledButtonIdBeforeAJAX) {
|
||||
F.enable(disabledButtonIdBeforeAJAX);
|
||||
}
|
||||
createErrorWindow(data);
|
||||
},
|
||||
@ -154,13 +196,26 @@
|
||||
|
||||
// 如果启用 Ajax,则所有对 __doPostBack 的调用都会到这里来
|
||||
function f__doPostBack(eventTarget, eventArgument) {
|
||||
var enableAjax;
|
||||
if (typeof (eventTarget) === 'boolean') {
|
||||
enableAjax = eventTarget;
|
||||
eventTarget = eventArgument;
|
||||
eventArgument = arguments[2];
|
||||
}
|
||||
|
||||
// 回发页面之前延时 100 毫秒,确保页面上的操作完成(比如选中复选框的动作)
|
||||
window.setTimeout(function () {
|
||||
|
||||
// theForm variable will always exist, because we invoke the GetPostBackEventReference in PageManager.
|
||||
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
|
||||
theForm.__EVENTTARGET.value = eventTarget;
|
||||
theForm.__EVENTARGUMENT.value = eventArgument;
|
||||
|
||||
// 设置当前请求是否为AJAX请求
|
||||
if (typeof (enableAjax) === 'boolean') {
|
||||
F.controlEnableAjax = enableAjax;
|
||||
}
|
||||
|
||||
f__doPostBack_internal();
|
||||
}
|
||||
}, 100);
|
||||
@ -326,7 +381,15 @@
|
||||
if(cmp.f_cellEditing) {
|
||||
// 可编辑单元格的表格
|
||||
// 选中单元格
|
||||
saveInHiddenField('SelectedCell', cmp.f_getSelectedCell().join(','));
|
||||
//saveInHiddenField('SelectedCell', cmp.f_getSelectedCell().join(','));
|
||||
|
||||
// 选中单元格
|
||||
var selectedCell = cmp.f_getSelectedCell();
|
||||
if (selectedCell && selectedCell.length) {
|
||||
saveInHiddenField('SelectedCell', JSON.stringify(selectedCell));
|
||||
} else {
|
||||
removeHiddenField('SelectedCell');
|
||||
}
|
||||
|
||||
//// 新增行
|
||||
//var newAddedRows = cmp.f_getNewAddedRows();
|
||||
@ -344,6 +407,7 @@
|
||||
removeHiddenField('ModifiedData');
|
||||
}
|
||||
|
||||
/*
|
||||
// 删除的行索引列表
|
||||
var deletedRows = cmp.f_getDeletedRows();
|
||||
if (deletedRows.length > 0) {
|
||||
@ -351,11 +415,19 @@
|
||||
} else {
|
||||
removeHiddenField('DeletedRows');
|
||||
}
|
||||
*/
|
||||
|
||||
} else {
|
||||
// 普通的表格
|
||||
// 选中行索引列表
|
||||
saveInHiddenField('SelectedRowIndexArray', cmp.f_getSelectedRows().join(','));
|
||||
//saveInHiddenField('SelectedRowIndexArray', cmp.f_getSelectedRows().join(','));
|
||||
// 选中行标识符列表
|
||||
var selectedRows = cmp.f_getSelectedRows();
|
||||
if (selectedRows && selectedRows.length) {
|
||||
saveInHiddenField('SelectedRows', JSON.stringify(selectedRows));
|
||||
} else {
|
||||
removeHiddenField('SelectedRows');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -419,7 +491,8 @@
|
||||
|
||||
// 显示“正在载入...”的提示信息
|
||||
function _showAjaxLoading(ajaxLoadingType) {
|
||||
if (_requestCount > 0) {
|
||||
// 延迟后,要再次检查当前有 AJAX 正在进行,才显示提示信息
|
||||
if (__ajaxUnderwayCount > 0) {
|
||||
|
||||
if (ajaxLoadingType === "default") {
|
||||
F.ajaxLoadingDefault.setStyle('left', (Ext.getBody().getWidth() - F.ajaxLoadingDefault.getWidth()) / 2 + 'px');
|
||||
@ -433,8 +506,7 @@
|
||||
|
||||
// 隐藏“正在载入...”的提示信息
|
||||
function _hideAjaxLoading(ajaxLoadingType) {
|
||||
if (_requestCount <= 0) {
|
||||
_requestCount = 0;
|
||||
if (__ajaxUnderwayCount === 0) {
|
||||
|
||||
if (ajaxLoadingType === "default") {
|
||||
F.ajaxLoadingDefault.hide();
|
||||
@ -445,46 +517,71 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 当前 Ajax 的并发请求数
|
||||
var _requestCount = 0;
|
||||
function ajaxStart() {
|
||||
|
||||
// 发起 Ajax 请求之前事件处理
|
||||
Ext.Ajax.on('beforerequest', function (conn, options) {
|
||||
_requestCount++;
|
||||
// 计数加一
|
||||
__ajaxUnderwayCount++;
|
||||
|
||||
// 仅在第一个 AJAX 发起时,延迟显示提示信息
|
||||
if (__ajaxUnderwayCount !== 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!enableAjaxLoading()) {
|
||||
// Do nothing
|
||||
} else {
|
||||
Ext.defer(_showAjaxLoading, 50, window, [ajaxLoadingType()]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function ajaxStop() {
|
||||
// 计数减一
|
||||
__ajaxUnderwayCount--;
|
||||
if (__ajaxUnderwayCount < 0) {
|
||||
__ajaxUnderwayCount = 0;
|
||||
}
|
||||
|
||||
if (!enableAjaxLoading()) {
|
||||
// ...
|
||||
} else {
|
||||
Ext.defer(_hideAjaxLoading, 0, window, [ajaxLoadingType()]);
|
||||
}
|
||||
|
||||
if (__ajaxUnderwayCount === 0) {
|
||||
F.controlEnableAjaxLoading = undefined;
|
||||
F.controlAjaxLoadingType = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
// 当前 Ajax 的并发请求数
|
||||
//var _requestCount = 0;
|
||||
var _ajaxStarted = false;
|
||||
|
||||
// 发起 Ajax 请求之前事件处理
|
||||
Ext.Ajax.on('beforerequest', function (conn, options) {
|
||||
//_requestCount++;
|
||||
|
||||
_ajaxStarted = true;
|
||||
ajaxStart();
|
||||
});
|
||||
|
||||
// Ajax 请求结束
|
||||
Ext.Ajax.on('requestcomplete', function (conn, options) {
|
||||
_requestCount--;
|
||||
//_requestCount--;
|
||||
_ajaxStarted = false;
|
||||
|
||||
if (!enableAjaxLoading()) {
|
||||
// ...
|
||||
} else {
|
||||
Ext.defer(_hideAjaxLoading, 0, window, [ajaxLoadingType()]);
|
||||
}
|
||||
F.control_enable_ajax_loading = undefined;
|
||||
F.control_ajax_loading_type = undefined;
|
||||
});
|
||||
|
||||
// Ajax 请求发生异常
|
||||
Ext.Ajax.on('requestexception', function (conn, options) {
|
||||
_requestCount--;
|
||||
//_requestCount--;
|
||||
_ajaxStarted = false;
|
||||
|
||||
|
||||
if (!enableAjaxLoading()) {
|
||||
// ...
|
||||
} else {
|
||||
Ext.defer(_hideAjaxLoading, 0, window, [ajaxLoadingType()]);
|
||||
}
|
||||
F.control_enable_ajax_loading = undefined;
|
||||
F.control_ajax_loading_type = undefined;
|
||||
});
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -4,18 +4,6 @@ var F = function (cmpName) {
|
||||
return Ext.getCmp(cmpName);
|
||||
};
|
||||
|
||||
F.state = function (cmp, state) {
|
||||
F.util.setFState(cmp, state);
|
||||
};
|
||||
|
||||
F.enable = function (id) {
|
||||
F.util.enableSubmitControl(id);
|
||||
};
|
||||
|
||||
F.disable = function (id) {
|
||||
F.util.disableSubmitControl(id);
|
||||
};
|
||||
|
||||
F.target = function (target) {
|
||||
return F.util.getTargetWindow(target);
|
||||
};
|
||||
@ -46,6 +34,10 @@ F.ajaxReady = function () {
|
||||
F.beforeAjax = function () {
|
||||
F.util.beforeAjax.apply(window, arguments);
|
||||
};
|
||||
F.beforeAjaxSuccess = function () {
|
||||
F.util.beforeAjaxSuccess.apply(window, arguments);
|
||||
};
|
||||
|
||||
|
||||
F.stop = function () {
|
||||
var event = arguments.callee.caller.arguments[0] || window.event;
|
||||
@ -64,16 +56,6 @@ F.fieldValue = function (cmp) {
|
||||
return F.util.getFormFieldValue(cmp);
|
||||
};
|
||||
|
||||
F.customEvent = function (argument, validate) {
|
||||
var pmv = F.pagemanager.validate;
|
||||
if (validate && pmv) {
|
||||
if (!F.util.validForms(pmv.forms, pmv.target, pmv.messagebox)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
__doPostBack(F.pagemanager.name, argument);
|
||||
};
|
||||
|
||||
F.getHidden = function () {
|
||||
return F.util.getHiddenFieldValue.apply(window, arguments);
|
||||
};
|
||||
@ -85,15 +67,77 @@ F.addCSS = function () {
|
||||
F.util.addCSS.apply(window, arguments);
|
||||
};
|
||||
|
||||
|
||||
// 更新EventValidation的值
|
||||
F.eventValidation = function (newValue) {
|
||||
F.setHidden("__EVENTVALIDATION", newValue);
|
||||
F.initTreeTabStrip = function () {
|
||||
F.util.initTreeTabStrip.apply(window, arguments);
|
||||
};
|
||||
|
||||
|
||||
F.addMainTab = function () {
|
||||
F.util.addMainTab.apply(window, arguments);
|
||||
};
|
||||
|
||||
F.getActiveWindow = function () {
|
||||
return F.wnd.getActiveWindow.apply(window, arguments);
|
||||
};
|
||||
|
||||
|
||||
// 记录最后一个控件的序号
|
||||
F.f_objectIndex = 0;
|
||||
|
||||
|
||||
// 为了兼容保留函数签名:F.customEvent
|
||||
F.f_customEvent = F.customEvent = function (argument, validate) {
|
||||
//var pmv = F.f_pagemanager.validate;
|
||||
//if (validate && pmv) {
|
||||
// if (!F.util.validForms(pmv.forms, pmv.target, pmv.messagebox)) {
|
||||
// return false;
|
||||
// }
|
||||
//}
|
||||
//__doPostBack(F.f_pagemanager.name, argument);
|
||||
|
||||
var enableAjax;
|
||||
if (typeof(argument) === 'boolean') {
|
||||
enableAjax = argument;
|
||||
argument = validate;
|
||||
validate = arguments[2];
|
||||
}
|
||||
|
||||
var pmv = F.f_pagemanager.validate;
|
||||
if (validate && pmv) {
|
||||
if (!F.util.validateForms(pmv.forms, pmv.target, pmv.messagebox)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof (enableAjax) === 'boolean') {
|
||||
__doPostBack(enableAjax, F.f_pagemanager.name, argument);
|
||||
} else {
|
||||
__doPostBack(F.f_pagemanager.name, argument);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 更新EventValidation的值
|
||||
F.f_eventValidation = function (newValue) {
|
||||
F.setHidden("__EVENTVALIDATION", newValue);
|
||||
};
|
||||
|
||||
F.f_state = function (cmp, state) {
|
||||
F.util.setFState(cmp, state);
|
||||
};
|
||||
|
||||
// 为了兼容保留函数签名:F.enable
|
||||
F.f_enable = F.enable = function (id) {
|
||||
F.util.enableSubmitControl(id);
|
||||
};
|
||||
|
||||
// 为了兼容保留函数签名:F.disable
|
||||
F.f_disable = F.disable = function (id) {
|
||||
F.util.disableSubmitControl(id);
|
||||
};
|
||||
|
||||
// 更新ViewState的值
|
||||
F.viewState = function (viewStateBeforeAJAX, newValue, startIndex) {
|
||||
F.f_viewState = function (viewStateBeforeAJAX, newValue, startIndex) {
|
||||
var viewStateHiddenFiledId = '__VIEWSTATE';
|
||||
|
||||
var oldValue = F.getHidden(viewStateHiddenFiledId);
|
||||
@ -133,7 +177,7 @@ F.viewState = function (viewStateBeforeAJAX, newValue, startIndex) {
|
||||
// expires: 天
|
||||
// 新增 或者 修改Cookie
|
||||
F.cookie = function (key, value, options) {
|
||||
if (typeof(value) === 'undefined') {
|
||||
if (typeof (value) === 'undefined') {
|
||||
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
||||
var result = key ? '' : {};
|
||||
Ext.Array.each(cookies, function (cookie, index) {
|
||||
@ -184,15 +228,34 @@ F.removeCookie = function (key, options) {
|
||||
};
|
||||
|
||||
|
||||
// 能否访问 iframe 中的 window.F 对象
|
||||
F.canAccess = function (iframeWnd) {
|
||||
|
||||
// 访问 iframeWnd.F 时,可能出现错误 Blocked a frame with origin "http://fineui.com/" from accessing a cross-origin frame.
|
||||
// Blocked:这个问题出现在 http://fineui.com/ 页面加载一个 http://baidu.com/ 的 iframe 页面
|
||||
try {
|
||||
iframeWnd.F;
|
||||
iframeWnd.window;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!iframeWnd.F || !iframeWnd.window) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
Ext.onReady(function () {
|
||||
|
||||
// 加延迟,以保证在 zh_CN 中通过 Ext.onReady 注册的脚本先执行(其中对 Ext.Date 进行了初始化)
|
||||
window.setTimeout(function () {
|
||||
F.util.triggerLoad();
|
||||
|
||||
|
||||
F.util.triggerReady();
|
||||
|
||||
|
||||
F.util.hidePageLoading();
|
||||
}, 0);
|
||||
|
||||
});
|
||||
|
||||
@ -213,7 +276,7 @@ Ext.onReady(function () {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
// 能否访问 iframe 中的 window.F 对象
|
||||
function canIFrameWindowAccessed(iframeWnd) {
|
||||
|
||||
@ -231,6 +294,7 @@ Ext.onReady(function () {
|
||||
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
// FineUI常用函数域(Utility)
|
||||
@ -271,18 +335,17 @@ Ext.onReady(function () {
|
||||
|
||||
F.ajax.hookPostBack();
|
||||
|
||||
F.global_enable_ajax = F.enableAjax;
|
||||
|
||||
F.global_enable_ajax_loading = F.enableAjaxLoading;
|
||||
F.global_ajax_loading_type = F.ajaxLoadingType;
|
||||
//F.global_enable_ajax = F.enableAjax;
|
||||
//F.global_enable_ajax_loading = F.enableAjaxLoading;
|
||||
//F.global_ajax_loading_type = F.ajaxLoadingType;
|
||||
|
||||
// 添加Ajax Loading提示节点
|
||||
F.ajaxLoadingDefault = Ext.get(F.util.appendLoadingNode());
|
||||
F.ajaxLoadingMask = Ext.create('Ext.LoadMask', Ext.getBody(), { msg: F.util.loading });
|
||||
|
||||
|
||||
F.form_upload_file = false;
|
||||
F.global_disable_ajax = false;
|
||||
//F.form_upload_file = false;
|
||||
//F.global_disable_ajax = false;
|
||||
//F.x_window_manager = new Ext.WindowManager();
|
||||
//F.x_window_manager.zseed = 6000;
|
||||
|
||||
@ -365,6 +428,7 @@ Ext.onReady(function () {
|
||||
_readyList: [],
|
||||
_ajaxReadyList: [],
|
||||
_beforeAjaxList: [],
|
||||
_beforeAjaxSuccessList: [],
|
||||
_loadList: [],
|
||||
|
||||
ready: function (callback) {
|
||||
@ -372,7 +436,7 @@ Ext.onReady(function () {
|
||||
},
|
||||
triggerReady: function () {
|
||||
Ext.Array.each(F.util._readyList, function (item, index) {
|
||||
item.call(window);
|
||||
item.apply(window);
|
||||
});
|
||||
},
|
||||
|
||||
@ -382,7 +446,7 @@ Ext.onReady(function () {
|
||||
},
|
||||
triggerAjaxReady: function () {
|
||||
Ext.Array.each(F.util._ajaxReadyList, function (item, index) {
|
||||
item.call(window);
|
||||
item.apply(window);
|
||||
});
|
||||
},
|
||||
|
||||
@ -390,9 +454,26 @@ Ext.onReady(function () {
|
||||
F.util._beforeAjaxList.push(callback);
|
||||
},
|
||||
triggerBeforeAjax: function () {
|
||||
var result = true, args = arguments;
|
||||
Ext.Array.each(F.util._beforeAjaxList, function (item, index) {
|
||||
item.call(window);
|
||||
if (item.apply(window, args) === false) {
|
||||
result = false;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
},
|
||||
|
||||
beforeAjaxSuccess: function (callback) {
|
||||
F.util._beforeAjaxSuccessList.push(callback);
|
||||
},
|
||||
triggerBeforeAjaxSuccess: function () {
|
||||
var result = true, args = arguments;
|
||||
Ext.Array.each(F.util._beforeAjaxSuccessList, function (item, index) {
|
||||
if (item.apply(window, args) === false) {
|
||||
result = false;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
},
|
||||
|
||||
|
||||
@ -401,7 +482,7 @@ Ext.onReady(function () {
|
||||
},
|
||||
triggerLoad: function () {
|
||||
Ext.Array.each(F.util._loadList, function (item, index) {
|
||||
item.call(window);
|
||||
item.apply(window);
|
||||
});
|
||||
},
|
||||
|
||||
@ -492,24 +573,7 @@ Ext.onReady(function () {
|
||||
},
|
||||
|
||||
|
||||
// 弹出Alert对话框
|
||||
alert: function (msg, title, icon, okscript) {
|
||||
title = title || F.util.alertTitle;
|
||||
icon = icon || Ext.MessageBox.INFO;
|
||||
Ext.MessageBox.show({
|
||||
title: title,
|
||||
msg: msg,
|
||||
buttons: Ext.MessageBox.OK,
|
||||
icon: icon,
|
||||
fn: function (buttonId) {
|
||||
if (buttonId === "ok") {
|
||||
if (typeof (okscript) === "function") {
|
||||
okscript.call(window);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 向页面添加Loading...节点
|
||||
appendLoadingNode: function () {
|
||||
@ -632,7 +696,7 @@ Ext.onReady(function () {
|
||||
iframeEls.each(function (iframeEl) {
|
||||
var iframeWnd = iframeEl.dom.contentWindow;
|
||||
|
||||
if (!canIFrameWindowAccessed(iframeWnd)) {
|
||||
if (!F.canAccess(iframeWnd)) {
|
||||
return true; // continue
|
||||
}
|
||||
|
||||
@ -836,6 +900,7 @@ Ext.onReady(function () {
|
||||
Ext.removeNode(node.dom);
|
||||
}
|
||||
|
||||
/*
|
||||
var ss1;
|
||||
|
||||
if (isCSSFile) {
|
||||
@ -859,6 +924,32 @@ Ext.onReady(function () {
|
||||
|
||||
var hh1 = document.getElementsByTagName("head")[0];
|
||||
hh1.appendChild(ss1);
|
||||
*/
|
||||
|
||||
var ss1;
|
||||
var hh1 = document.getElementsByTagName('head')[0];
|
||||
if (isCSSFile) {
|
||||
ss1 = document.createElement('link');
|
||||
//ss1.setAttribute('type', 'text/css');
|
||||
ss1.setAttribute('rel', 'stylesheet');
|
||||
ss1.setAttribute('id', id);
|
||||
ss1.setAttribute('href', content);
|
||||
hh1.appendChild(ss1);
|
||||
} else {
|
||||
// Tricks From: http://www.phpied.com/dynamic-script-and-style-elements-in-ie/
|
||||
ss1 = document.createElement('style');
|
||||
//ss1.setAttribute('type', 'text/css');
|
||||
ss1.setAttribute('id', id);
|
||||
// Update: note that it's important for IE that you append the style to the head *before* setting its content. Otherwise IE678 will *crash* is the css string contains an @import.
|
||||
hh1.appendChild(ss1);
|
||||
if (ss1.styleSheet) { // IE
|
||||
ss1.styleSheet.cssText = content;
|
||||
} else { // the world
|
||||
var tt1 = document.createTextNode(content);
|
||||
ss1.appendChild(tt1);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/*
|
||||
@ -1194,7 +1285,7 @@ Ext.onReady(function () {
|
||||
|
||||
// 对话框图标
|
||||
getMessageBoxIcon: function (iconShortName) {
|
||||
var icon = Ext.MessageBox.WARNING;
|
||||
var icon = iconShortName || Ext.MessageBox.WARNING;
|
||||
if (iconShortName === 'info') {
|
||||
icon = Ext.MessageBox.INFO;
|
||||
} else if (iconShortName === 'warning') {
|
||||
@ -1207,32 +1298,102 @@ Ext.onReady(function () {
|
||||
return icon;
|
||||
},
|
||||
|
||||
// 确认对话框
|
||||
confirm: function (targetName, title, msg, okScript, cancelScript, iconShortName) {
|
||||
var wnd = F.util.getTargetWindow(targetName);
|
||||
var icon = F.util.getMessageBoxIcon(iconShortName);
|
||||
// 弹出Alert对话框
|
||||
alert: function (target, message, title, messageIcon, ok) { // 老的顺序:msg, title, icon, okscript
|
||||
var args = [].slice.call(arguments, 0);
|
||||
|
||||
var options = args[0];
|
||||
if (typeof (options) === 'string') {
|
||||
if (!/^_self|_parent|_top$/.test(args[0])) {
|
||||
args.splice(0, 0, '_self');
|
||||
}
|
||||
options = {
|
||||
target: args[0],
|
||||
message: args[1],
|
||||
title: args[2],
|
||||
messageIcon: args[3],
|
||||
ok: args[4]
|
||||
};
|
||||
}
|
||||
|
||||
var wnd = F.util.getTargetWindow(options.target);
|
||||
if (!F.canAccess(wnd)) {
|
||||
return; // return
|
||||
}
|
||||
|
||||
var icon = Ext.MessageBox.INFO;
|
||||
if (options.messageIcon) {
|
||||
icon = F.util.getMessageBoxIcon(options.messageIcon);
|
||||
}
|
||||
|
||||
wnd.Ext.MessageBox.show({
|
||||
title: title || F.util.confirmTitle,
|
||||
msg: msg,
|
||||
cls: options.cls || '',
|
||||
title: options.title || F.util.alertTitle,
|
||||
msg: options.message,
|
||||
buttons: Ext.MessageBox.OK,
|
||||
icon: icon,
|
||||
fn: function (buttonId) {
|
||||
if (buttonId === "ok") {
|
||||
if (typeof (options.ok) === "function") {
|
||||
options.ok.call(window);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 确认对话框
|
||||
confirm: function (target, message, title, messageIcon, ok, cancel) { // 老的顺序:targetName, title, msg, okScript, cancelScript, iconShortName)
|
||||
|
||||
var args = [].slice.call(arguments, 0); //$.makeArray(arguments);
|
||||
|
||||
var options = args[0];
|
||||
if (typeof (options) === 'string') {
|
||||
if (!/^_self|_parent|_top$/.test(args[0])) {
|
||||
args.splice(0, 0, '_self');
|
||||
}
|
||||
options = {
|
||||
target: args[0],
|
||||
message: args[1],
|
||||
title: args[2],
|
||||
messageIcon: args[3],
|
||||
ok: args[4],
|
||||
cancel: args[5]
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
var wnd = F.util.getTargetWindow(options.target);
|
||||
if (!F.canAccess(wnd)) {
|
||||
return; // return
|
||||
}
|
||||
|
||||
var icon = F.util.getMessageBoxIcon(options.messageIcon);
|
||||
wnd.Ext.MessageBox.show({
|
||||
cls: options.cls || '',
|
||||
title: options.title || F.util.confirmTitle,
|
||||
msg: options.message,
|
||||
buttons: Ext.MessageBox.OKCANCEL,
|
||||
icon: icon,
|
||||
fn: function (btn) {
|
||||
if (btn == 'cancel') {
|
||||
if (cancelScript) {
|
||||
if (typeof (cancelScript) === 'string') {
|
||||
new Function(cancelScript)();
|
||||
if (options.cancel) {
|
||||
if (typeof (options.cancel) === 'string') {
|
||||
new Function(options.cancel)();
|
||||
} else {
|
||||
cancelScript.apply(wnd);
|
||||
options.cancel.apply(wnd);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (okScript) {
|
||||
if (typeof (okScript) === 'string') {
|
||||
new Function(okScript)();
|
||||
if (options.ok) {
|
||||
if (typeof (options.ok) === 'string') {
|
||||
new Function(options.ok)();
|
||||
} else {
|
||||
okScript.apply(wnd);
|
||||
options.ok.apply(wnd);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
@ -1297,6 +1458,8 @@ Ext.onReady(function () {
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
noop: function () { }
|
||||
|
||||
};
|
||||
|
@ -66,11 +66,16 @@
|
||||
// isGoldenSection : 弹出窗体位于页面的黄金分隔位置
|
||||
// hiddenHiddenFieldID : 隐藏表单字段记录此窗体是否弹出,也页面回发时保持状态用
|
||||
show: function (panel, iframeUrl, windowTitle, left, top, isGoldenSection, hiddenHiddenFieldID, width, height) {
|
||||
var target = F.util.getTargetWindow(panel['f_property_target']);
|
||||
var guid = panel['f_property_guid'];
|
||||
if (window.frameElement && target !== window) {
|
||||
// 当前页面在IFrame中(也即时 window.frameElement 存在)
|
||||
// 此弹出窗体需要在父窗口中弹出
|
||||
var target = F.util.getTargetWindow(panel.f_property_target);
|
||||
var guid = panel.f_property_guid;
|
||||
|
||||
// 当前页面在IFrame中(window.frameElement 存在) - 这个判断有问题
|
||||
// ----如果外部页面是 http://a.com/ 而内部页面是 http://b.com/ 在 b.com 内弹出窗体时, window.frameElement 就会出现拒绝访问
|
||||
|
||||
// parent != window - 当前窗体不是顶层窗体
|
||||
// target !== window - 并且当前窗体不是需要弹出的位置(target)
|
||||
if (parent != window && target !== window) {
|
||||
|
||||
if (!target.F[guid]) {
|
||||
// 父窗口中已经创建了这个Ext-Window对象
|
||||
var wrapper = guid + '_wrapper';
|
||||
@ -81,14 +86,19 @@
|
||||
}
|
||||
// Ext.apply 的第三个参数是default obejct
|
||||
var config = Ext.apply({}, {
|
||||
'renderTo': wrapper,
|
||||
'id': guid,
|
||||
'f_property_window': window,
|
||||
'f_property_ext_window': panel
|
||||
renderTo: wrapper,
|
||||
id: guid,
|
||||
f_property_window: window,
|
||||
f_property_ext_window: panel
|
||||
}, panel.initialConfig);
|
||||
delete config.f_state;
|
||||
delete config.items;
|
||||
delete config.listeners;
|
||||
|
||||
|
||||
// 在父页面中创建一个Ext-Window的幻影(拷贝)
|
||||
target.F[guid] = target.Ext.create('Ext.window.Window', config);
|
||||
//target.F[guid] = target.Ext.create('Ext.window.Window', config);
|
||||
target.F.wnd.createGhostWindow(config);
|
||||
}
|
||||
panel = target.F[guid];
|
||||
}
|
||||
@ -127,11 +137,48 @@
|
||||
panel.setPosition(leftTop.left, leftTop.top);
|
||||
}
|
||||
|
||||
/*
|
||||
if (panel.maximizable) {
|
||||
F.wnd.fixMaximize(panel);
|
||||
}
|
||||
*/
|
||||
|
||||
F.wnd.fixMaximize(panel);
|
||||
},
|
||||
|
||||
createGhostWindow: function (config) {
|
||||
|
||||
var ghostWnd = Ext.create('Ext.window.Window', config);
|
||||
ghostWnd.on('beforeclose', function () {
|
||||
|
||||
// 如果原始窗体所在的页面存在,则触发原始窗体的 beforeclose 事件
|
||||
if (F.canAccess(config.f_property_window)) {
|
||||
config.f_property_ext_window.fireEvent('beforeclose', config.f_property_ext_window);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// 如果原始窗体已经被关闭,则不拦截 beforeclose 事件,会简单的关闭窗体
|
||||
|
||||
});
|
||||
|
||||
|
||||
ghostWnd.on('maximize', function () {
|
||||
|
||||
// 如果原始窗体所在的页面存在,则触发原始窗体的 maximize 事件
|
||||
if (F.canAccess(config.f_property_window)) {
|
||||
config.f_property_ext_window.fireEvent('maximize', config.f_property_ext_window);
|
||||
} else {
|
||||
F.wnd.fixMaximize(ghostWnd);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
F[config.id] = ghostWnd;
|
||||
},
|
||||
|
||||
|
||||
// 获取Ghost Panel实例
|
||||
getGhostPanel: function (panel, targetName, guid) {
|
||||
if (typeof (targetName) === 'undefined') {
|
||||
@ -141,7 +188,7 @@
|
||||
guid = panel.f_property_guid;
|
||||
}
|
||||
var target = F.util.getTargetWindow(targetName);
|
||||
if (window.frameElement && target !== window) {
|
||||
if (parent != window && target !== window) {
|
||||
// 从父页面中查找幻影Ext-Window对象
|
||||
panel = target.F[guid];
|
||||
}
|
||||
@ -173,6 +220,8 @@
|
||||
maximize: function (panel) {
|
||||
var panel = F.wnd.getGhostPanel(panel);
|
||||
panel.maximize();
|
||||
|
||||
F.wnd.fixMaximize(panel);
|
||||
},
|
||||
|
||||
// 最小化
|
||||
@ -191,7 +240,7 @@
|
||||
// 现在的 Window 控件时渲染在 from 表单里面的一个 DIV 中的
|
||||
fixMaximize: function (panel) {
|
||||
if (panel.maximized) {
|
||||
var target = F.util.getTargetWindow(panel['f_property_target']);
|
||||
var target = F.util.getTargetWindow(panel.f_property_target);
|
||||
var bodySize = target.window.Ext.getBody().getViewSize();
|
||||
panel.setSize(bodySize.width, bodySize.height);
|
||||
// 不要忘记左上角坐标
|
||||
@ -273,12 +322,14 @@
|
||||
},
|
||||
|
||||
// 返回当前活动Window组件对象(浏览器窗口对象通过F.wnd.getActiveWindow().window获取)
|
||||
getActiveWindow: function () {
|
||||
getActiveWindow: function (justParentWindow) {
|
||||
|
||||
// Ext.WindowManager.getActive();有可能返回一个弹出对话框
|
||||
function getActiveFineUIWindow(wnd) {
|
||||
var result = wnd.Ext.WindowManager.getActive();
|
||||
if (!result.f_property_guid) {
|
||||
|
||||
// 如果弹出的窗体不是 FineUI.Window 生成的窗体(有可能是Alert、Notify),则需要从排序列表中找
|
||||
if (result && !result.f_property_guid) {
|
||||
wnd.Ext.WindowManager.eachTopDown(function (cmp) {
|
||||
if (cmp.f_property_guid) {
|
||||
result = cmp;
|
||||
@ -291,10 +342,11 @@
|
||||
|
||||
var activeWindow = parent.window;
|
||||
var activeExtWindow = getActiveFineUIWindow(activeWindow);
|
||||
|
||||
if (activeExtWindow) {
|
||||
if (activeExtWindow['f_property_window']) {
|
||||
activeWindow = activeExtWindow['f_property_window'];
|
||||
activeExtWindow = activeExtWindow['f_property_ext_window'];
|
||||
if (activeExtWindow.f_property_window && !justParentWindow) {
|
||||
activeWindow = activeExtWindow.f_property_window;
|
||||
activeExtWindow = activeExtWindow.f_property_ext_window;
|
||||
}
|
||||
activeExtWindow.window = activeWindow;
|
||||
}
|
||||
@ -305,13 +357,61 @@
|
||||
// 向弹出此Ext-Window的页面写入值
|
||||
writeBackValue: function () {
|
||||
var aw = F.wnd.getActiveWindow();
|
||||
var controlIds = aw['f_property_save_state_control_client_ids'];
|
||||
if (F.canAccess(aw.window)) {
|
||||
var controlIds = aw.f_property_save_state_control_client_ids;
|
||||
var controlCount = Math.min(controlIds.length, arguments.length);
|
||||
for (var i = 0; i < controlCount; i++) {
|
||||
aw.window.Ext.getCmp(controlIds[i]).setValue(arguments[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
function hideActiveWindow(type, param) {
|
||||
var aw = F.getActiveWindow();
|
||||
if (aw) {
|
||||
if (F.canAccess(aw.window)) {
|
||||
if (type === 'hide') {
|
||||
aw.f_hide();
|
||||
} else if (type === 'hiderefresh') {
|
||||
aw.f_hide_refresh();
|
||||
} else if (type === 'hidepostback') {
|
||||
aw.f_hide_postback.call(aw, param)
|
||||
} else if (type === 'hideexecutescript') {
|
||||
aw.f_hide_executescript.call(aw, param)
|
||||
}
|
||||
} else {
|
||||
var parentAW = F.getActiveWindow(true);
|
||||
parentAW.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 当前激活窗体
|
||||
F.activeWnd = {
|
||||
|
||||
hide: function () {
|
||||
hideActiveWindow('hide');
|
||||
},
|
||||
|
||||
hideRefresh: function () {
|
||||
hideActiveWindow('hiderefresh');
|
||||
},
|
||||
|
||||
hidePostBack: function (param) {
|
||||
hideActiveWindow('hidepostback', param);
|
||||
},
|
||||
|
||||
hideExecuteScript: function (param) {
|
||||
hideActiveWindow('hideexecutescript', param);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
})();
|
||||
|
@ -334,69 +334,78 @@ if (Ext.form.field.Base) {
|
||||
if (this.setFieldLabel) {
|
||||
this.setFieldLabel(text);
|
||||
}
|
||||
},
|
||||
|
||||
f_setReadOnly: function (readonly) {
|
||||
var me = this;
|
||||
|
||||
if (typeof (readonly) === 'undefined') {
|
||||
readonly = me.f_state['Readonly'];
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
if (Ext.form.field.Time) {
|
||||
Ext.override(Ext.form.field.Time, {
|
||||
|
||||
// Time 继承自 ComboBox,这个函数被覆盖了,因此需要重新定义
|
||||
f_setValue: function (value) {
|
||||
if (typeof (value) === 'undefined') {
|
||||
value = this.f_state['Text'];
|
||||
if (me.setReadOnly) {
|
||||
me.setReadOnly(readonly);
|
||||
}
|
||||
|
||||
if (readonly) {
|
||||
me.el.addCls('f-readonly');
|
||||
} else {
|
||||
me.el.removeCls('f-readonly');
|
||||
}
|
||||
this.setValue(value);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (Ext.form.field.HtmlEditor) {
|
||||
Ext.override(Ext.form.field.HtmlEditor, {
|
||||
if (Ext.form.Label) {
|
||||
Ext.override(Ext.form.Label, {
|
||||
|
||||
f_setValue: function (text) {
|
||||
if (typeof (text) === 'undefined') {
|
||||
text = this.f_state['Text'];
|
||||
f_setReadOnly: function (readonly) {
|
||||
var me = this;
|
||||
|
||||
if (typeof (readonly) === 'undefined') {
|
||||
readonly = me.f_state['Readonly'];
|
||||
}
|
||||
|
||||
if (me.setReadOnly) {
|
||||
me.setReadOnly(readonly);
|
||||
}
|
||||
|
||||
if (readonly) {
|
||||
me.el.addCls('f-readonly');
|
||||
} else {
|
||||
me.el.removeCls('f-readonly');
|
||||
}
|
||||
this.setValue(text);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (Ext.form.field.Checkbox) {
|
||||
Ext.override(Ext.form.field.Checkbox, {
|
||||
|
||||
f_setValue: function () {
|
||||
this.setValue(this.f_state['Checked']);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (Ext.form.RadioGroup) {
|
||||
Ext.override(Ext.form.RadioGroup, {
|
||||
|
||||
f_setValue: function (value) {
|
||||
value = value || this.f_state['SelectedValue'];
|
||||
var selectedObj = {};
|
||||
selectedObj[this.name] = value;
|
||||
this.setValue(selectedObj);
|
||||
//Ext.form.CheckboxGroup.prototype.f_setValue.apply(this, [value]);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (Ext.form.CheckboxGroup) {
|
||||
Ext.override(Ext.form.CheckboxGroup, {
|
||||
|
||||
f_setReadOnly: function (readonly) {
|
||||
var me = this;
|
||||
|
||||
if (typeof (readonly) === 'undefined') {
|
||||
readonly = me.f_state['Readonly'];
|
||||
}
|
||||
|
||||
if (me.setReadOnly) {
|
||||
me.setReadOnly(readonly);
|
||||
}
|
||||
|
||||
if (readonly) {
|
||||
me.el.addCls('f-readonly');
|
||||
} else {
|
||||
me.el.removeCls('f-readonly');
|
||||
}
|
||||
},
|
||||
|
||||
f_reloadData: function (name, isradiogroup) {
|
||||
var container = this.ownerCt;
|
||||
var newConfig = Ext.apply(this.initialConfig, {
|
||||
@ -465,6 +474,63 @@ if (Ext.form.CheckboxGroup) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (Ext.form.field.Time) {
|
||||
Ext.override(Ext.form.field.Time, {
|
||||
|
||||
// Time 继承自 ComboBox,这个函数被覆盖了,因此需要重新定义
|
||||
f_setValue: function (value) {
|
||||
if (typeof (value) === 'undefined') {
|
||||
value = this.f_state['Text'];
|
||||
}
|
||||
this.setValue(value);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (Ext.form.field.HtmlEditor) {
|
||||
Ext.override(Ext.form.field.HtmlEditor, {
|
||||
|
||||
f_setValue: function (text) {
|
||||
if (typeof (text) === 'undefined') {
|
||||
text = this.f_state['Text'];
|
||||
}
|
||||
this.setValue(text);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (Ext.form.field.Checkbox) {
|
||||
Ext.override(Ext.form.field.Checkbox, {
|
||||
|
||||
f_setValue: function () {
|
||||
this.setValue(this.f_state['Checked']);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (Ext.form.RadioGroup) {
|
||||
Ext.override(Ext.form.RadioGroup, {
|
||||
|
||||
f_setValue: function (value) {
|
||||
value = value || this.f_state['SelectedValue'];
|
||||
var selectedObj = {};
|
||||
selectedObj[this.name] = value;
|
||||
this.setValue(selectedObj);
|
||||
//Ext.form.CheckboxGroup.prototype.f_setValue.apply(this, [value]);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (Ext.form.field.ComboBox) {
|
||||
Ext.override(Ext.form.field.ComboBox, {
|
||||
// Load data from local cache.
|
||||
@ -560,7 +626,7 @@ if (Ext.grid.Panel) {
|
||||
Ext.override(Ext.grid.Panel, {
|
||||
|
||||
f_getData: function () {
|
||||
var $this = this, data = this.f_state['F_Rows']['Values'];
|
||||
var $this = this, rows = this.f_state['F_Rows'];
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
var tpls = this.f_getTpls(this.f_tpls);
|
||||
@ -597,6 +663,7 @@ if (Ext.grid.Panel) {
|
||||
*/
|
||||
|
||||
// 不要改变 F_Rows.Values 的原始数据,因为这个值会被POST到后台
|
||||
/*
|
||||
var newdata = [], newdataitem;
|
||||
Ext.Array.each(data, function (row, rowIndex) {
|
||||
newdataitem = [];
|
||||
@ -611,6 +678,34 @@ if (Ext.grid.Panel) {
|
||||
});
|
||||
newdata.push(newdataitem);
|
||||
});
|
||||
*/
|
||||
|
||||
var newdata = [];
|
||||
Ext.Array.each(rows, function (row, rowIndex) {
|
||||
var newdataitem = [];
|
||||
|
||||
// row['0'] -> Values
|
||||
Ext.Array.each(row['0'], function (item, cellIndex) {
|
||||
var newcellvalue = item;
|
||||
if (typeof (item) === 'string' && item.substr(0, 7) === "#@TPL@#") {
|
||||
var clientId = $this.id + '_' + item.substr(7);
|
||||
newcellvalue = '<div id="' + clientId + '_container">' + tplsHash[clientId] + '</div>';
|
||||
}
|
||||
|
||||
newdataitem.push(newcellvalue);
|
||||
});
|
||||
|
||||
// idProperty
|
||||
var rowId = row['6'];
|
||||
if (typeof (rowId) === 'undefined') {
|
||||
// 如果未定义 id,要生成一个 id,用来记录选中的行(否则在行调整顺序后,选中的行就乱了)
|
||||
rowId = 'fineui_row_' + rowIndex;
|
||||
}
|
||||
newdataitem.push(rowId);
|
||||
|
||||
|
||||
newdata.push(newdataitem);
|
||||
});
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
return newdata;
|
||||
@ -695,6 +790,7 @@ if (Ext.grid.Panel) {
|
||||
|
||||
|
||||
if (this.f_cellEditing) {
|
||||
this.f_cellEditing.cancelEdit();
|
||||
store.commitChanges();
|
||||
this.f_initRecordIDs();
|
||||
}
|
||||
@ -765,13 +861,17 @@ if (Ext.grid.Panel) {
|
||||
|
||||
// 选中某些行
|
||||
f_selectRows: function (rows) {
|
||||
rows = rows || this.f_state['SelectedRowIndexArray'] || [];
|
||||
var sm = this.getSelectionModel();
|
||||
if (sm.select) {
|
||||
var me = this;
|
||||
rows = rows || me.f_state['SelectedRowIDArray'] || [];
|
||||
|
||||
var sm = me.getSelectionModel();
|
||||
var store = me.getStore();
|
||||
|
||||
if (rows.length && sm.select) {
|
||||
sm.deselectAll(true);
|
||||
Ext.Array.each(rows, function (row, index) {
|
||||
// select( records, [keepExisting], [suppressEvent] )
|
||||
sm.select(row, true, true);
|
||||
sm.select(store.getById(row), true, true);
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -786,14 +886,15 @@ if (Ext.grid.Panel) {
|
||||
|
||||
// 获取选中的行
|
||||
f_getSelectedRows: function () {
|
||||
var selectedRows = [];
|
||||
var sm = this.getSelectionModel();
|
||||
var me = this, selectedRows = [];
|
||||
|
||||
var sm = me.getSelectionModel();
|
||||
if (sm.getSelection) {
|
||||
var selection = sm.getSelection();
|
||||
var store = this.getStore();
|
||||
var store = me.getStore();
|
||||
|
||||
Ext.Array.each(selection, function (record, index) {
|
||||
selectedRows.push(store.indexOf(record));
|
||||
selectedRows.push(record.getId());
|
||||
});
|
||||
}
|
||||
|
||||
@ -802,30 +903,45 @@ if (Ext.grid.Panel) {
|
||||
|
||||
|
||||
// 选中单元格(AllowCellEditing)
|
||||
f_selectCell: function (cell) {
|
||||
cell = cell || this.f_state['SelectedCell'] || [];
|
||||
var sm = this.getSelectionModel();
|
||||
if (sm.select) {
|
||||
if (cell.length === 2) {
|
||||
sm.setCurrentPosition({
|
||||
row: cell[0],
|
||||
column: cell[1]
|
||||
});
|
||||
} else {
|
||||
// TODO:
|
||||
//sm.deselectAll();
|
||||
f_selectCell: function (rowId, columnId) {
|
||||
var me = this;
|
||||
|
||||
var cell = rowId;
|
||||
if(typeof(cell) === 'undefined') {
|
||||
cell = me.f_state['SelectedCell'] || [];
|
||||
} else if(!Ext.isArray(cell)) {
|
||||
cell = [rowId, columnId];
|
||||
}
|
||||
|
||||
var sm = me.getSelectionModel();
|
||||
if (cell.length === 2) {
|
||||
// 支持[行索引,列索引],也支持[行Id,列Id]
|
||||
var row = cell[0];
|
||||
var column = cell[1];
|
||||
|
||||
if(typeof(row) === 'string') {
|
||||
row = me.f_getRow(row);
|
||||
}
|
||||
|
||||
if(typeof(column) === 'string') {
|
||||
column = me.f_getColumn(column);
|
||||
}
|
||||
|
||||
sm.setCurrentPosition({
|
||||
row: row,
|
||||
column: column
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 获取选中的单元格(AllowCellEditing)
|
||||
f_getSelectedCell: function () {
|
||||
var selectedCell = [], currentPos;
|
||||
var sm = this.getSelectionModel();
|
||||
var me = this, selectedCell = [], currentPos;
|
||||
var sm = me.getSelectionModel();
|
||||
if (sm.getCurrentPosition) {
|
||||
currentPos = sm.getCurrentPosition();
|
||||
if (currentPos) {
|
||||
selectedCell = [currentPos.row, currentPos.columnHeader.f_columnIndex];
|
||||
selectedCell = [currentPos.record.getId(), currentPos.columnHeader.id];
|
||||
}
|
||||
}
|
||||
return selectedCell;
|
||||
@ -1005,6 +1121,7 @@ if (Ext.grid.Panel) {
|
||||
f_commitChanges: function () {
|
||||
|
||||
if (this.f_cellEditing) {
|
||||
this.f_cellEditing.cancelEdit();
|
||||
this.getStore().commitChanges();
|
||||
this.f_initRecordIDs();
|
||||
}
|
||||
@ -1013,43 +1130,82 @@ if (Ext.grid.Panel) {
|
||||
|
||||
|
||||
// 从Store中删除选中的行(或者单元格)
|
||||
f_deleteSelected: function () {
|
||||
var $this = this;
|
||||
var store = this.getStore();
|
||||
f_deleteSelectedRows: function () {
|
||||
var me = this;
|
||||
var store = me.getStore();
|
||||
|
||||
var sm = this.getSelectionModel();
|
||||
var sm = me.getSelectionModel();
|
||||
if (sm.getSelection) {
|
||||
var rows = this.f_getSelectedRows();
|
||||
Ext.Array.each(rows, function (rowIndex, index) {
|
||||
store.removeAt(rowIndex);
|
||||
var rows = me.f_getSelectedRows();
|
||||
Ext.Array.each(rows, function (rowId, index) {
|
||||
store.remove(store.getById(rowId));
|
||||
});
|
||||
} else if (sm.getSelectedCell) {
|
||||
var selectedCell = this.f_getSelectedCell();
|
||||
var selectedCell = me.f_getSelectedCell();
|
||||
if (selectedCell.length) {
|
||||
store.removeAt(selectedCell[0]);
|
||||
store.remove(store.getById(selectedCell[0]));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
f_generateNewId: function () {
|
||||
var newid = 'fineui_' + F.f_objectIndex;
|
||||
|
||||
F.f_objectIndex++;
|
||||
|
||||
return newid;
|
||||
},
|
||||
|
||||
// 添加一条新纪录
|
||||
f_addNewRecord: function (defaultObj, appendToEnd) {
|
||||
var i, count, store = this.getStore();
|
||||
f_addNewRecord: function (defaultObj, appendToEnd, editColumnId) {
|
||||
var me = this, store = me.getStore();
|
||||
var newRecord = defaultObj; //new Ext.data.Model(defaultObj);
|
||||
|
||||
this.f_cellEditing.cancelEdit();
|
||||
|
||||
var rowIndex = 0;
|
||||
if (appendToEnd) {
|
||||
store.add(newRecord);
|
||||
rowIndex = store.getCount() - 1;
|
||||
} else {
|
||||
store.insert(0, newRecord);
|
||||
rowIndex = 0;
|
||||
// 如果设置了 id,则 extjs 认为这不是一个 phantom(幻影),而是一个真实存在的数据,rejectChanges 就不能去除这条数据了
|
||||
/*
|
||||
// 自动生成ID
|
||||
if(typeof(newRecord.__id) === 'undefined') {
|
||||
newRecord.__id = me.f_generateNewId();
|
||||
}
|
||||
this.f_cellEditing.startEditByPosition({
|
||||
row: rowIndex,
|
||||
column: this.f_firstEditableColumnIndex()
|
||||
});
|
||||
*/
|
||||
|
||||
|
||||
me.f_cellEditing.cancelEdit();
|
||||
|
||||
var newAddedRecords;
|
||||
//var rowIndex = 0;
|
||||
if (appendToEnd) {
|
||||
newAddedRecords = store.add(newRecord);
|
||||
//rowIndex = store.getCount() - 1;
|
||||
} else {
|
||||
newAddedRecords = store.insert(0, newRecord);
|
||||
//rowIndex = 0;
|
||||
}
|
||||
|
||||
var newAddedRecord = newAddedRecords[0];
|
||||
|
||||
|
||||
// phantom: True when the record does not yet exist in a server-side database (see setDirty). Any record which has a real database pk set as its id property is NOT a phantom -- it's real.
|
||||
// 如果设置了 id 属性,则 extjs 认为这不是一个 phantom(幻影),而是一个真实存在的数据,然后通过 getStore().getModifiedRecords() 就得不到这条记录了。
|
||||
// 所以需要设置 setDirty
|
||||
//newAddedRecord.setDirty(true);
|
||||
|
||||
var column;
|
||||
if (typeof (editColumnId) === 'undefined') {
|
||||
column = me.f_firstEditableColumn();
|
||||
} else {
|
||||
column = me.f_getColumn(editColumnId);
|
||||
}
|
||||
|
||||
me.f_cellEditing.startEdit(newAddedRecord, column);
|
||||
},
|
||||
|
||||
|
||||
f_startEdit: function(rowId, columnId) {
|
||||
var me = this;
|
||||
|
||||
me.f_cellEditing.startEdit(me.f_getRow(rowId), me.f_getColumn(columnId));
|
||||
},
|
||||
|
||||
//// 获取新增的行索引(在修改后的列表中)
|
||||
@ -1064,69 +1220,126 @@ if (Ext.grid.Panel) {
|
||||
// return newAddedRows;
|
||||
//},
|
||||
|
||||
/*
|
||||
// 获取删除的行索引(在原始的列表中)
|
||||
f_getDeletedRows: function () {
|
||||
var currentRecordIDs = [], deletedRows = [];
|
||||
this.getStore().each(function (record, index) {
|
||||
var me = this, currentRecordIDs = [], deletedRows = [];
|
||||
me.getStore().each(function (record, index) {
|
||||
currentRecordIDs.push(record.id);
|
||||
});
|
||||
|
||||
// 快速判断是否存在行被删除的情况
|
||||
if (currentRecordIDs.join('') === this.f_recordIDs.join('')) {
|
||||
return deletedRows;
|
||||
if (currentRecordIDs.join('') === me.f_recordIDs.join('')) {
|
||||
return []; // 没有行被删除
|
||||
}
|
||||
|
||||
Ext.Array.each(this.f_recordIDs, function (recordID, index) {
|
||||
|
||||
// 内存分页,特殊处理
|
||||
var originalIndexPlus = 0;
|
||||
var pagingBar = me.f_getPaging();
|
||||
if (pagingBar && !pagingBar.f_databasePaging) {
|
||||
originalIndexPlus = pagingBar.f_pageIndex * pagingBar.f_pageSize;
|
||||
}
|
||||
|
||||
|
||||
Ext.Array.each(me.f_recordIDs, function (recordID, index) {
|
||||
if (Ext.Array.indexOf(currentRecordIDs, recordID) < 0) {
|
||||
deletedRows.push(index);
|
||||
//deletedRows.push(index + originalIndexPlus);
|
||||
deletedRows.push({
|
||||
index: -1,
|
||||
originalIndex: index + originalIndexPlus,
|
||||
id: recordID,
|
||||
status: 'deleted'
|
||||
});
|
||||
}
|
||||
});
|
||||
return deletedRows;
|
||||
},
|
||||
*/
|
||||
|
||||
f_firstEditableColumnIndex: function () {
|
||||
var i = 0, count = this.columns.length, column;
|
||||
for (; i < count; i++) {
|
||||
column = this.columns[i];
|
||||
if ((column.getEditor && column.getEditor()) || column.xtype === 'checkcolumn') {
|
||||
return i;
|
||||
f_firstEditableColumn: function () {
|
||||
var me = this, columns = me.f_getColumns();
|
||||
|
||||
for (var i = 0, count = columns.length; i < count; i++) {
|
||||
var column = columns[i];
|
||||
if (me.f_columnEditable(column)) {
|
||||
return column;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
return undefined;
|
||||
},
|
||||
|
||||
f_columnEditable: function (columnID) {
|
||||
var i = 0, count = this.columns.length, column;
|
||||
for (; i < count; i++) {
|
||||
column = this.columns[i];
|
||||
if (column.id === columnID) {
|
||||
if ((column.getEditor && column.getEditor()) || column.xtype === 'checkcolumn') {
|
||||
var me = this, columns = me.f_getColumns();
|
||||
|
||||
var column = columnID;
|
||||
if (typeof (columnID) === 'string') {
|
||||
column = me.f_getColumn(column);
|
||||
}
|
||||
|
||||
if (column && column.f_editable) {
|
||||
return true;
|
||||
/*
|
||||
if((column.getEditor && column.getEditor()) || column.xtype === 'checkcolumn') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
|
||||
f_getColumn: function (columnID) {
|
||||
var me = this, columns = me.f_getColumns();
|
||||
|
||||
for (var i=0, count = columns.length; i < count; i++) {
|
||||
var column = columns[i];
|
||||
if (column.id === columnID) {
|
||||
return column;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
|
||||
f_getRow: function(rowId) {
|
||||
var me = this, store = me.getStore();
|
||||
return store.getById(rowId);
|
||||
},
|
||||
|
||||
f_getCellValue: function(rowId, columnId) {
|
||||
var me = this;
|
||||
|
||||
var row = me.f_getRow(rowId);
|
||||
if(row && row.data) {
|
||||
return row.data[columnId];
|
||||
}
|
||||
|
||||
return undefined;
|
||||
},
|
||||
|
||||
f_updateCellValue: function(rowId, columnId, newvalue) {
|
||||
var me = this;
|
||||
|
||||
var row = me.f_getRow(rowId);
|
||||
if(row && row.set) {
|
||||
row.set(columnId, newvalue);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/*
|
||||
// 获取用户修改的单元格值
|
||||
f_getModifiedData: function () {
|
||||
var me = this, i, j, count, columns = this.f_getColumns();
|
||||
|
||||
/*
|
||||
Ext.Array.each(columns, function (column, index) {
|
||||
columnMap[column.id] = column;
|
||||
});
|
||||
|
||||
function checkColumnEditable(columnID) {
|
||||
var column = columnMap[columnID];
|
||||
if (column && (column.hasEditor() || column.xtype === 'checkcolumn')) {
|
||||
return true;
|
||||
// 内存分页,特殊处理
|
||||
var originalIndexPlus = 0;
|
||||
var pagingBar = me.f_getPaging();
|
||||
if (pagingBar && !pagingBar.f_databasePaging) {
|
||||
originalIndexPlus = pagingBar.f_pageIndex * pagingBar.f_pageSize;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
var modifiedRows = [];
|
||||
var store = this.getStore();
|
||||
@ -1172,12 +1385,108 @@ if (Ext.grid.Panel) {
|
||||
}
|
||||
}
|
||||
// 修改现有数据行
|
||||
modifiedRows.push([rowIndex, rowIndexOriginal, rowModifiedObj]);
|
||||
modifiedRows.push([rowIndex, rowIndexOriginal + originalIndexPlus, rowModifiedObj]);
|
||||
}
|
||||
}
|
||||
|
||||
// 结果按照 rowIndex 升序排序
|
||||
return modifiedRows.sort(function (a, b) { return a[0] - b[0]; });
|
||||
},
|
||||
*/
|
||||
|
||||
// 获取用户修改的单元格值
|
||||
f_getModifiedData: function () {
|
||||
var me = this, i, j, count, columns = me.f_getColumns();
|
||||
|
||||
// 内存分页,特殊处理
|
||||
var originalIndexPlus = 0;
|
||||
var pagingBar = me.f_getPaging();
|
||||
if (pagingBar && !pagingBar.f_databasePaging) {
|
||||
originalIndexPlus = pagingBar.f_pageIndex * pagingBar.f_pageSize;
|
||||
}
|
||||
|
||||
var modifiedRows = [];
|
||||
var store = me.getStore();
|
||||
var modifiedRecords = store.getModifiedRecords();
|
||||
for (i = 0, count = modifiedRecords.length; i < count; i++) {
|
||||
var modifiedRecord = modifiedRecords[i];
|
||||
var recordID = modifiedRecord.id;
|
||||
var rowId = modifiedRecord.getId(); // getId() is not the same as id property
|
||||
var rowIndex = store.indexOf(modifiedRecord);
|
||||
var rowData = modifiedRecord.data;
|
||||
if (rowIndex < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 本行数据在原始数据集合中的行索引
|
||||
var rowIndexOriginal = Ext.Array.indexOf(me.f_recordIDs, recordID);
|
||||
if (rowIndexOriginal < 0) {
|
||||
var newRowData = {};
|
||||
//for (var columnID in rowData) {
|
||||
Ext.Object.each(rowData, function (columnID, value) {
|
||||
//if (me.f_columnEditable(columnID)) {
|
||||
//delete rowData[columnID];
|
||||
var column = me.f_getColumn(columnID);
|
||||
if (column && (column.f_columnType === 'rendercheckfield' || column.f_columnType === 'renderfield')) {
|
||||
var newData = rowData[columnID];
|
||||
// 如果是日期对象,则转化为字符串
|
||||
if (F.util.isDate(newData)) {
|
||||
newData = F.util.resolveGridDateToString(me.f_fields, columnID, newData);
|
||||
}
|
||||
newRowData[columnID] = newData;
|
||||
}
|
||||
//}
|
||||
});
|
||||
// 新增数据行
|
||||
//modifiedRows.push([rowIndex, -1, newRowData]);
|
||||
modifiedRows.push({
|
||||
index: rowIndex,
|
||||
originalIndex: -1,
|
||||
id: rowId,
|
||||
values: newRowData,
|
||||
status: 'newadded'
|
||||
});
|
||||
} else {
|
||||
var rowModifiedObj = {};
|
||||
Ext.Object.each(modifiedRecord.modified, function(columnID, value) {
|
||||
//for (var columnID in modifiedRecord.modified) {
|
||||
// 不删除非可编辑列,比如[总成绩(不可编辑)]列不可编辑,但是可以通过代码更改
|
||||
//if (me.f_columnEditable(columnID)) {
|
||||
var newData = rowData[columnID];
|
||||
// 如果是日期对象,则转化为字符串
|
||||
if (F.util.isDate(newData)) {
|
||||
newData = F.util.resolveGridDateToString(me.f_fields, columnID, newData);
|
||||
}
|
||||
rowModifiedObj[columnID] = newData;
|
||||
//}
|
||||
});
|
||||
// 修改现有数据行
|
||||
//modifiedRows.push([rowIndex, rowIndexOriginal + originalIndexPlus, rowModifiedObj]);
|
||||
modifiedRows.push({
|
||||
index: rowIndex,
|
||||
originalIndex: rowIndexOriginal + originalIndexPlus,
|
||||
id: rowId,
|
||||
values: rowModifiedObj,
|
||||
status: 'modified'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 删除的行
|
||||
//modifiedRows = modifiedRows.concat(me.f_getDeletedRows());
|
||||
var removedRecords = store.getRemovedRecords();
|
||||
Ext.Array.each(removedRecords, function (record, index) {
|
||||
var recordOriginalIndex = Ext.Array.indexOf(me.f_recordIDs, record.id);
|
||||
modifiedRows.push({
|
||||
index: -1,
|
||||
originalIndex: recordOriginalIndex + originalIndexPlus,
|
||||
id: record.getId(),
|
||||
status: 'deleted'
|
||||
});
|
||||
});
|
||||
|
||||
// 结果按照 originalIndex 升序排序
|
||||
return modifiedRows.sort(function (a, b) { return a.originalIndex - b.originalIndex; });
|
||||
}
|
||||
|
||||
});
|
||||
@ -1229,7 +1538,9 @@ if (Ext.tree.Panel) {
|
||||
// 19 - EnableExpandEvent
|
||||
// 20 - EnableCollapseEvent
|
||||
|
||||
// 21 - Nodes
|
||||
// 21 - CssClass
|
||||
|
||||
// 22 - Nodes
|
||||
node.text = data[0];
|
||||
node.leaf = !!data[1];
|
||||
node.id = data[2];
|
||||
@ -1262,9 +1573,12 @@ if (Ext.tree.Panel) {
|
||||
node.f_enableexpandevent = !!data[19];
|
||||
node.f_enablecollapseevent = !!data[20];
|
||||
|
||||
if (data[21]) {
|
||||
node.cls = data[21];
|
||||
}
|
||||
|
||||
if (data[21] && data[21].length > 0) {
|
||||
node.children = that.f_tranformData(data[21]);
|
||||
if (data[22] && data[22].length > 0) {
|
||||
node.children = that.f_tranformData(data[22]);
|
||||
}
|
||||
|
||||
nodes.push(node);
|
||||
@ -1516,7 +1830,7 @@ if (Ext.window.Window) {
|
||||
me.f_hide();
|
||||
|
||||
if (me.f_property_enable_ajax === false) {
|
||||
F.control_enable_ajax = false;
|
||||
F.controlEnableAjax = false;
|
||||
}
|
||||
|
||||
// 如果argument为undefined,则传入 __doPostBack 的 argument 应该为空字符串
|
||||
@ -1630,9 +1944,11 @@ if (Ext.ux.grid && Ext.ux.grid.ColumnHeaderGroup) {
|
||||
|
||||
|
||||
|
||||
// 修正IE7/IE8下Date.parse('2015-10-01')出错的问题
|
||||
// http://jibbering.com/faq/#parseDate
|
||||
|
||||
(function () {
|
||||
|
||||
// 修正IE7/IE8下Date.parse('2015-10-01')出错的问题
|
||||
// http://jibbering.com/faq/#parseDate
|
||||
function parseISO8601(dateStr) {
|
||||
var isoExp = /(\d{2,4})-(\d\d?)-(\d\d?)/,
|
||||
date = new Date(NaN), month,
|
||||
@ -1657,18 +1973,27 @@ if (Ext.ux.grid && Ext.ux.grid.ColumnHeaderGroup) {
|
||||
return date;
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
|
||||
|
||||
if (Ext.form.field.ComboBox) {
|
||||
F.originalComboSetValue = Ext.form.field.ComboBox.prototype.setValue;
|
||||
if (Ext.form.field.ComboBox) {
|
||||
var originalComboSetValue = Ext.form.field.ComboBox.prototype.setValue;
|
||||
Ext.form.field.ComboBox.prototype.setValue = function (value, doSelect) {
|
||||
// value可能是数字(可编辑单元格,列的FieldType可能是Int)
|
||||
if (typeof (value) === 'number' || typeof (value) === 'boolean') {
|
||||
value += '';
|
||||
}
|
||||
return F.originalComboSetValue.apply(this, [value, doSelect]);
|
||||
return originalComboSetValue.apply(this, [value, doSelect]);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
})();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
Ext.apply(F.ajax, {
|
||||
errorMsg: "出错了!{0} ({1})",
|
||||
timeoutErrorMsg: "请求超时,请刷新页面并重试!"
|
||||
|
10
FineUI.Examples/extjs_builder/js/修改ext-all.js(为了支持 IE11).txt
Normal file
10
FineUI.Examples/extjs_builder/js/修改ext-all.js(为了支持 IE11).txt
Normal file
@ -0,0 +1,10 @@
|
||||
在 ext-all.js 中找到如下代码:
|
||||
window.undefined=window.undefined;(function(){var q=function(e){return e.test(Ext.userAgent)},v=document.compatMode=="CSS1Compat",H=function(T,S){var e;return(T&&(e=S.exec(Ext.userAgent)))?parseFloat(e[1]):0},r=document.documentMode,a=q(/opera/),x=a&&q(/version\/10\.5/),M=q(/\bchrome\b/),B=q(/webkit/),c=!M&&q(/safari/),K=c&&q(/applewebkit\/4/),I=c&&q(/version\/3/),F=c&&q(/version\/4/),l=c&&q(/version\/5\.0/),E=c&&q(/version\/5/),k=!a&&q(/msie/),L=k&&((q(/msie 7/)&&r!=8&&r!=9&&r!=10)||r==7),J=k&&((q(/msie 8/)&&r!=7&&r!=9&&r!=10)||r==8),G=k&&((q(/msie 9/)&&r!=7&&r!=8&&r!=10)||r==9),h=k&&((q(/msie 10/)&&r!=7&&r!=8&&r!=9)||r==10),O=k&&q(/msie 6/),b=!B&&q(/gecko/),R=b&&q(/rv:1\.9/),Q=b&&q(/rv:2\.0/),P=b&&q(/rv:5\./),t=b&&q(/rv:10\./),A=R&&q(/rv:1\.9\.0/),y=R&&q(/rv:1\.9\.1/),w=R&&q(/rv:1\.9\.2/),g=q(/windows|win32/),D=q(/macintosh|mac os x/),z=q(/linux/),n=null,o=H(true,/\bchrome\/(\d+\.\d+)/),j=H(true,/\bfirefox\/(\d+\.\d+)/),p=H(k,/msie (\d+\.\d+)/),u=H(a,/version\/(\d+\.\d+)/),d=H(c,/version\/(\d+\.\d+)/),C=H(B,/webkit\/(\d+\.\d+)/),s=/^https/i.test(window.location.protocol),m;
|
||||
|
||||
这段代码后面加上:
|
||||
|
||||
Ext._isIE = !a && (q(/msie/) || q(/trident/)),
|
||||
Ext._isIE11 = k && ((q(/trident\/7\.0/) && r != 7 && r != 8 && r != 9 && r != 10) || r == 11);
|
||||
if (Ext._isIE11) {
|
||||
k = L = J = G = h = O = false;
|
||||
}
|
@ -168,3 +168,9 @@
|
||||
-webkit-user-select: text;
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
.f-formrow .x-column-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
|
@ -1 +1 @@
|
||||
v4.2.0
|
||||
v4.2.3
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
@ -76,13 +76,13 @@
|
||||
var selectedCheckboxs = list2.getValue(), selectedValues, i;
|
||||
|
||||
if (Ext.Object.isEmpty(selectedCheckboxs)) {
|
||||
top.F.util.alert("列表一没有选中项!");
|
||||
top.F.alert("列表一没有选中项!");
|
||||
} else {
|
||||
selectedValues = [];
|
||||
Ext.Object.each(selectedCheckboxs, function (key, value) {
|
||||
selectedValues.push(value);
|
||||
});
|
||||
top.F.util.alert("列表一选中项的值:" + selectedValues.join(','));
|
||||
top.F.alert("列表一选中项的值:" + selectedValues.join(','));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.result img {
|
||||
border: 1px solid #CCCCCC;
|
||||
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.photo {
|
||||
height: 150px;
|
||||
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.photo {
|
||||
height: 150px;
|
||||
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="_form1" runat="server">
|
||||
@ -22,8 +22,8 @@
|
||||
</f:FormRow>
|
||||
<f:FormRow ColumnWidths="50% 50%">
|
||||
<Items>
|
||||
<f:DropDownList ID="DropDownList1" runat="server" Label="下拉列表">
|
||||
<f:ListItem Text="可选项 1" Value="0" Selected="true"></f:ListItem>
|
||||
<f:DropDownList ID="DropDownList1" runat="server" Label="下拉列表" Required="true" ShowRedStar="true" AutoSelectFirstItem="false">
|
||||
<f:ListItem Text="可选项 1" Value="0"></f:ListItem>
|
||||
<f:ListItem Text="可选项 2" Value="1"></f:ListItem>
|
||||
</f:DropDownList>
|
||||
<f:TextBox ID="TextBox1" ShowRedStar="true" runat="server" Label="文本框" Required="true"
|
||||
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.mypanel {
|
||||
text-align: center;
|
||||
|
86
FineUI.Examples/form/form_columnwidths.aspx
Normal file
86
FineUI.Examples/form/form_columnwidths.aspx
Normal file
@ -0,0 +1,86 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="form_columnwidths.aspx.cs" Inherits="FineUI.Examples.form.form_columnwidths" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.speciallabel .x-form-display-field {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="_form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" runat="server" />
|
||||
<f:Form Width="600px" LabelWidth="80px" BodyPadding="5px" EnableCollapse="true" LabelAlign="Left"
|
||||
ID="Form2" runat="server" Title="表单">
|
||||
<Rows>
|
||||
<f:FormRow ColumnWidths="20px 50% 50%">
|
||||
<Items>
|
||||
<f:Label runat="server" CssClass="speciallabel" Text="1."></f:Label>
|
||||
<f:Label ID="Label3" Label="电话" Text="0551-1234567" runat="server" />
|
||||
<f:Label ID="Label16" runat="server" Label="申请人" Text="admin">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow ColumnWidths="20px 50% 50%">
|
||||
<Items>
|
||||
<f:Label ID="Label1" runat="server" CssClass="speciallabel" Text="2."></f:Label>
|
||||
<f:Label ID="Label4" Label="编号" Text="200804170006" runat="server" />
|
||||
<f:TextBox ID="TextBox2" Required="true" ShowRedStar="true" Label="电子邮箱" RegexPattern="EMAIL"
|
||||
RegexMessage="请输入有效的邮箱地址!" runat="server">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow ColumnWidths="20px 100%">
|
||||
<Items>
|
||||
<f:Label ID="Label2" runat="server" CssClass="speciallabel" Text="3."></f:Label>
|
||||
<f:DropDownList ID="DropDownList3" Label="审批人" runat="server" ForceSelection="false" Required="true" ShowRedStar="True">
|
||||
<f:ListItem Text="老大甲" Value="0"></f:ListItem>
|
||||
<f:ListItem Text="老大乙" Value="1"></f:ListItem>
|
||||
<f:ListItem Text="老大丙" Value="2"></f:ListItem>
|
||||
</f:DropDownList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow ColumnWidths="20px 100%">
|
||||
<Items>
|
||||
<f:Label ID="Label5" runat="server" CssClass="speciallabel" Text="4."></f:Label>
|
||||
<f:NumberBox ID="NumberBox1" Label="申请数量" NoDecimal="true" NoNegative="true" MaxValue="1000" Required="true" runat="server"
|
||||
ShowRedStar="True" />
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow ColumnWidths="20px 100%">
|
||||
<Items>
|
||||
<f:Label ID="Label6" runat="server" CssClass="speciallabel" Text="5."></f:Label>
|
||||
<f:TextArea ID="TextArea1" runat="server" Label="描述" ShowRedStar="True" Required="True">
|
||||
</f:TextArea>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Panel ID="Panel2" runat="server" ShowBorder="false"
|
||||
ShowHeader="false">
|
||||
<Items>
|
||||
<f:Button ID="btnSubmitForm2" Text="提交表单" CssClass="marginr" runat="server" OnClick="btnSubmitForm2_Click"
|
||||
ValidateForms="Form2">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
<br />
|
||||
<br />
|
||||
注:假设行的总宽度是 100px,行的属性 ColumnWidths="20px 50% 50%",则:
|
||||
<ul>
|
||||
<li>第一个字段宽度:20px</li>
|
||||
<li>第二个字段宽度:40px</li>
|
||||
<li>第三个字段宽度:40px</li>
|
||||
</ul>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
27
FineUI.Examples/form/form_columnwidths.aspx.cs
Normal file
27
FineUI.Examples/form/form_columnwidths.aspx.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUI.Examples.form
|
||||
{
|
||||
public partial class form_columnwidths : PageBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnSubmitForm2_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowNotify("表单 2 验证并提交成功!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
159
FineUI.Examples/form/form_columnwidths.aspx.designer.cs
generated
Normal file
159
FineUI.Examples/form/form_columnwidths.aspx.designer.cs
generated
Normal file
@ -0,0 +1,159 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUI.Examples.form {
|
||||
|
||||
|
||||
public partial class form_columnwidths {
|
||||
|
||||
/// <summary>
|
||||
/// _form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm _form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Form2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Form Form2;
|
||||
|
||||
/// <summary>
|
||||
/// Label3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label Label3;
|
||||
|
||||
/// <summary>
|
||||
/// Label16 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label Label16;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label Label1;
|
||||
|
||||
/// <summary>
|
||||
/// Label4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label Label4;
|
||||
|
||||
/// <summary>
|
||||
/// TextBox2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.TextBox TextBox2;
|
||||
|
||||
/// <summary>
|
||||
/// Label2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label Label2;
|
||||
|
||||
/// <summary>
|
||||
/// DropDownList3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.DropDownList DropDownList3;
|
||||
|
||||
/// <summary>
|
||||
/// Label5 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label Label5;
|
||||
|
||||
/// <summary>
|
||||
/// NumberBox1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.NumberBox NumberBox1;
|
||||
|
||||
/// <summary>
|
||||
/// Label6 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label Label6;
|
||||
|
||||
/// <summary>
|
||||
/// TextArea1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.TextArea TextArea1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Panel Panel2;
|
||||
|
||||
/// <summary>
|
||||
/// btnSubmitForm2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button btnSubmitForm2;
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -3,9 +3,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="_form1" runat="server">
|
||||
@ -112,7 +112,36 @@
|
||||
</f:Button>
|
||||
<f:Button ID="btnEnablePanel" Text="启用表单面板" CssClass="marginr" runat="server" OnClick="btnEnablePanel_Click">
|
||||
</f:Button>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<f:Button ID="Button2" Text="添加只读样式(类似禁用样式)" CssClass="marginr" runat="server" EnablePostBack="false">
|
||||
<Listeners>
|
||||
<f:Listener Event="click" Handler="addReadonlyStyle" />
|
||||
</Listeners>
|
||||
</f:Button>
|
||||
<f:Button ID="Button3" Text="删除只读样式" CssClass="marginr" runat="server" EnablePostBack="false">
|
||||
<Listeners>
|
||||
<f:Listener Event="click" Handler="removeReadonlyStyle" />
|
||||
</Listeners>
|
||||
</f:Button>
|
||||
</form>
|
||||
<textarea id="readonlycss_holder" style="display: none;">
|
||||
.f-readonly {
|
||||
opacity: .5;
|
||||
filter: alpha(opacity=50);
|
||||
}
|
||||
</textarea>
|
||||
<script src="../res/js/jquery.min.js" type="text/javascript"></script>
|
||||
<script>
|
||||
|
||||
function addReadonlyStyle() {
|
||||
F.addCSS('readonlycss', $('#readonlycss_holder').val());
|
||||
}
|
||||
|
||||
function removeReadonlyStyle() {
|
||||
$('#readonlycss').remove();
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -35,22 +35,16 @@ namespace FineUI.Examples.form
|
||||
protected void btnReadOnlyAll_Click(object sender, EventArgs e)
|
||||
{
|
||||
ResolveFormField(delegate(Field field)
|
||||
{
|
||||
if (!(field is Label))
|
||||
{
|
||||
field.Readonly = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected void btnCancelReadOnlyAll_Click(object sender, EventArgs e)
|
||||
{
|
||||
ResolveFormField(delegate(Field field)
|
||||
{
|
||||
if (!(field is Label))
|
||||
{
|
||||
field.Readonly = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
18
FineUI.Examples/form/form_disabled.aspx.designer.cs
generated
18
FineUI.Examples/form/form_disabled.aspx.designer.cs
generated
@ -236,5 +236,23 @@ namespace FineUI.Examples.form {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button btnEnablePanel;
|
||||
|
||||
/// <summary>
|
||||
/// Button2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button Button2;
|
||||
|
||||
/// <summary>
|
||||
/// Button3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button Button3;
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -4,12 +4,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.redcolor {
|
||||
}
|
||||
</style>
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="_form1" runat="server">
|
||||
@ -19,37 +16,33 @@
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Label ID="labTitle" Label="标题" HideMode="Display" Text="申请单" runat="server" />
|
||||
<f:Label ID="labLiuShuiHao" Label="流水号" HideMode="Visibility" Text="123456789" runat="server" />
|
||||
<f:Label ID="labTitle" HideMode="Visibility" Label="标题" Text="申请单" runat="server" />
|
||||
<f:Label ID="labLiuShuiHao" Label="流水号" Text="123456789" runat="server" />
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<f:FormRow runat="server" ID="FormRow2">
|
||||
<Items>
|
||||
<f:Label ID="Label3" Label="电话" Text="0551-1234567" runat="server" />
|
||||
<f:Label ID="labPhone" Label="电话" Text="0551-1234567" runat="server" />
|
||||
<f:Label ID="Label16" runat="server" Label="申请人" Text="admin">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<f:FormRow runat="server" ID="FormRow3" HideMode="Visibility">
|
||||
<Items>
|
||||
<f:Label ID="Label4" Label="编号" Text="200804170006" runat="server" />
|
||||
<f:TextBox ID="TextBox2" Required="true" ShowRedStar="true" Label="电子邮箱" RegexPattern="EMAIL" EmptyText="请输入常用电子邮箱"
|
||||
<f:TextBox ID="TextBox2" Required="true" ShowRedStar="true" Label="电子邮箱" EmptyText="请输入常用电子邮箱" RegexPattern="EMAIL"
|
||||
RegexMessage="请输入有效的邮箱地址!" runat="server">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="DropDownList3" Label="审批人" EmptyText="请选择审批人" Required="true" runat="server" ShowRedStar="True" AutoSelectFirstItem="false">
|
||||
<f:DropDownList ID="DropDownList3" Label="审批人" Required="true" EmptyText="请选择审批人" runat="server" ShowRedStar="True" AutoSelectFirstItem="false">
|
||||
<f:ListItem Text="老大甲" Value="0"></f:ListItem>
|
||||
<f:ListItem Text="老大乙" Value="1"></f:ListItem>
|
||||
<f:ListItem Text="老大丙" Value="2"></f:ListItem>
|
||||
</f:DropDownList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox ID="NumberBox1" Label="申请数量" EmptyText="请输入申请数量" MaxValue="1000" Required="true" runat="server"
|
||||
<f:NumberBox ID="NumberBox1" Label="申请数量" NoDecimal="true" NoNegative="true" EmptyText="请输入申请数量" MaxValue="1000" Required="true" runat="server"
|
||||
ShowRedStar="True" />
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
@ -74,15 +67,31 @@
|
||||
</Rows>
|
||||
</f:Form>
|
||||
<br />
|
||||
<f:Button ID="btnShowHideTitle" Text="显示隐藏标题" CssClass="marginr" runat="server"
|
||||
<f:Button ID="btnShowHideTitle" Text="显示隐藏[标题]" CssClass="marginr" runat="server"
|
||||
OnClick="btnShowHideTitle_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnShowHideLiuShuiHao" Text="显示隐藏流水号" runat="server"
|
||||
OnClick="btnShowHideLiuShuiHao_Click">
|
||||
<f:Button ID="btnShowHidePhone" Text="显示隐藏[电话]" runat="server"
|
||||
OnClick="btnShowHidePhone_Click">
|
||||
</f:Button>
|
||||
<br />
|
||||
<br />
|
||||
注意:比较上述两个按钮的异同(控件的HideMode属性)。
|
||||
<f:Button ID="btnShowHideFormRow2" Text="显示隐藏第二行" CssClass="marginr" runat="server"
|
||||
OnClick="btnShowHideFormRow2_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnShowHideFormRow3" Text="显示隐藏第三行(隐藏后显示空白行)" CssClass="marginr" runat="server"
|
||||
OnClick="btnShowHideFormRow3_Click">
|
||||
</f:Button>
|
||||
<br />
|
||||
<br />
|
||||
注:
|
||||
<ul>
|
||||
<li>
|
||||
对比隐藏[标题]和隐藏[电话]的不同之处([标题]的HideMode=Visibility)
|
||||
</li>
|
||||
<li>
|
||||
对比隐藏第二行和隐藏第三行的不同之处(FormRow3的HideMode=Visibility)
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -18,13 +18,13 @@ namespace FineUI.Examples.form
|
||||
|
||||
protected void btnSubmitForm2_Click(object sender, EventArgs e)
|
||||
{
|
||||
Alert.ShowInTop("表单验证并提交成功!");
|
||||
ShowNotify("表单验证并提交成功!");
|
||||
}
|
||||
|
||||
|
||||
protected void btnShowHideLiuShuiHao_Click(object sender, EventArgs e)
|
||||
protected void btnShowHidePhone_Click(object sender, EventArgs e)
|
||||
{
|
||||
labLiuShuiHao.Hidden = !labLiuShuiHao.Hidden;
|
||||
labPhone.Hidden = !labPhone.Hidden;
|
||||
}
|
||||
|
||||
protected void btnShowHideTitle_Click(object sender, EventArgs e)
|
||||
@ -32,6 +32,18 @@ namespace FineUI.Examples.form
|
||||
labTitle.Hidden = !labTitle.Hidden;
|
||||
}
|
||||
|
||||
protected void btnShowHideFormRow2_Click(object sender, EventArgs e)
|
||||
{
|
||||
FormRow2.Hidden = !FormRow2.Hidden;
|
||||
}
|
||||
|
||||
|
||||
protected void btnShowHideFormRow3_Click(object sender, EventArgs e)
|
||||
{
|
||||
FormRow3.Hidden = !FormRow3.Hidden;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -58,13 +58,22 @@ namespace FineUI.Examples.form {
|
||||
protected global::FineUI.Label labLiuShuiHao;
|
||||
|
||||
/// <summary>
|
||||
/// Label3 控件。
|
||||
/// FormRow2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label Label3;
|
||||
protected global::FineUI.FormRow FormRow2;
|
||||
|
||||
/// <summary>
|
||||
/// labPhone 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label labPhone;
|
||||
|
||||
/// <summary>
|
||||
/// Label16 控件。
|
||||
@ -75,6 +84,15 @@ namespace FineUI.Examples.form {
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label Label16;
|
||||
|
||||
/// <summary>
|
||||
/// FormRow3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.FormRow FormRow3;
|
||||
|
||||
/// <summary>
|
||||
/// Label4 控件。
|
||||
/// </summary>
|
||||
@ -148,12 +166,30 @@ namespace FineUI.Examples.form {
|
||||
protected global::FineUI.Button btnShowHideTitle;
|
||||
|
||||
/// <summary>
|
||||
/// btnShowHideLiuShuiHao 控件。
|
||||
/// btnShowHidePhone 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button btnShowHideLiuShuiHao;
|
||||
protected global::FineUI.Button btnShowHidePhone;
|
||||
|
||||
/// <summary>
|
||||
/// btnShowHideFormRow2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button btnShowHideFormRow2;
|
||||
|
||||
/// <summary>
|
||||
/// btnShowHideFormRow3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button btnShowHideFormRow3;
|
||||
}
|
||||
}
|
||||
|
53
FineUI.Examples/form/form_labelwidth.aspx
Normal file
53
FineUI.Examples/form/form_labelwidth.aspx
Normal file
@ -0,0 +1,53 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="form_labelwidth.aspx.cs" Inherits="FineUI.Examples.form.form_labelwidth" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="_form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" runat="server" />
|
||||
<f:Form Width="650px" BodyPadding="5px" ID="Form1" LabelWidth="120px" LabelAlign="Right" EnableCollapse="true"
|
||||
runat="server" Title="表单(LabelWidth=120 LabelAlign=Right)">
|
||||
<Rows>
|
||||
<f:FormRow ColumnWidths="50% 50%">
|
||||
<Items>
|
||||
<f:Label ID="Label1" runat="server" Label="标签" LabelWidth="150px" LabelAlign="Left" Text="标签的值">
|
||||
</f:Label>
|
||||
<f:CheckBox ID="CheckBox1" runat="server" Text="复选框" Label="复选框">
|
||||
</f:CheckBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow ColumnWidths="50% 50%">
|
||||
<Items>
|
||||
<f:DropDownList ID="DropDownList1" runat="server" Required="true" LabelWidth="150px" LabelAlign="Left"
|
||||
ShowRedStar="true" AutoSelectFirstItem="false" Label="下拉列表(长标签)">
|
||||
<f:ListItem Text="可选项 1" Value="0"></f:ListItem>
|
||||
<f:ListItem Text="可选项 2" Value="1"></f:ListItem>
|
||||
</f:DropDownList>
|
||||
<f:TextBox ID="TextBox1" ShowRedStar="true" runat="server" Label="文本框" Required="true"
|
||||
Text="">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Panel ID="Panel1" runat="server" CssStyle="text-align: right;" ShowBorder="false" ShowHeader="false">
|
||||
<Items>
|
||||
<f:Button runat="server" Text="验证此表单并提交" ValidateForms="Form1"
|
||||
ID="btnSubmitForm1" OnClick="btnSubmitForm1_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
<br />
|
||||
注:表单字段定义的 LabelWidth 和 LabelAlign 属性会覆盖 Form 的同名属性
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
27
FineUI.Examples/form/form_labelwidth.aspx.cs
Normal file
27
FineUI.Examples/form/form_labelwidth.aspx.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUI.Examples.form
|
||||
{
|
||||
public partial class form_labelwidth : PageBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnSubmitForm1_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowNotify("表单 1 验证并提交成功!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
96
FineUI.Examples/form/form_labelwidth.aspx.designer.cs
generated
Normal file
96
FineUI.Examples/form/form_labelwidth.aspx.designer.cs
generated
Normal file
@ -0,0 +1,96 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUI.Examples.form {
|
||||
|
||||
|
||||
public partial class form_labelwidth {
|
||||
|
||||
/// <summary>
|
||||
/// _form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm _form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Form Form1;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label Label1;
|
||||
|
||||
/// <summary>
|
||||
/// CheckBox1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.CheckBox CheckBox1;
|
||||
|
||||
/// <summary>
|
||||
/// DropDownList1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.DropDownList DropDownList1;
|
||||
|
||||
/// <summary>
|
||||
/// TextBox1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.TextBox TextBox1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSubmitForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button btnSubmitForm1;
|
||||
}
|
||||
}
|
30
FineUI.Examples/form/form_longlabel.aspx
Normal file
30
FineUI.Examples/form/form_longlabel.aspx
Normal file
@ -0,0 +1,30 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="form_longlabel.aspx.cs" Inherits="FineUI.Examples.form.form_longlabel" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" runat="server" />
|
||||
<f:SimpleForm ID="SimpleForm1" BodyPadding="5px" Width="550px" EnableCollapse="true"
|
||||
Title="简单表单" runat="server">
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="文本输入框(很长很长很长的标签)" ID="tbxUserName" Required="true" ShowRedStar="true">
|
||||
</f:TextBox>
|
||||
<f:TriggerBox ID="tbxMyBox1" ShowLabel="true" ShowRedStar="True" Required="true" Label="触发器输入框(很长很长很长的标签)" Readonly="false" TriggerIcon="Search" runat="server">
|
||||
</f:TriggerBox>
|
||||
<f:NumberBox Label="数字输入框(很长很长很长的标签)" ID="NumberBox5" runat="server" ShowRedStar="True" Required="true" />
|
||||
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="日期选择器(很长很长很长的标签)"
|
||||
ID="DatePicker1" ShowRedStar="True" Required="true">
|
||||
</f:DatePicker>
|
||||
<f:Button ID="btnSubmit" runat="server" ValidateForms="SimpleForm1" Text="提交表单" OnClick="btnSubmit_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:SimpleForm>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
26
FineUI.Examples/form/form_longlabel.aspx.cs
Normal file
26
FineUI.Examples/form/form_longlabel.aspx.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUI.Examples.form
|
||||
{
|
||||
public partial class form_longlabel : PageBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void btnSubmit_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowNotify("表单验证成功");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
87
FineUI.Examples/form/form_longlabel.aspx.designer.cs
generated
Normal file
87
FineUI.Examples/form/form_longlabel.aspx.designer.cs
generated
Normal file
@ -0,0 +1,87 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUI.Examples.form {
|
||||
|
||||
|
||||
public partial class form_longlabel {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.SimpleForm SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// tbxUserName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.TextBox tbxUserName;
|
||||
|
||||
/// <summary>
|
||||
/// tbxMyBox1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.TriggerBox tbxMyBox1;
|
||||
|
||||
/// <summary>
|
||||
/// NumberBox5 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.NumberBox NumberBox5;
|
||||
|
||||
/// <summary>
|
||||
/// DatePicker1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.DatePicker DatePicker1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSubmit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button btnSubmit;
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.redcolor {
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.customlabel span {
|
||||
color: red;
|
||||
|
68
FineUI.Examples/form/layout_center_label.aspx
Normal file
68
FineUI.Examples/form/layout_center_label.aspx
Normal file
@ -0,0 +1,68 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="layout_center_label.aspx.cs"
|
||||
Inherits="FineUI.Examples.form.layout_center_label" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.formtitle .x-form-display-field {
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
line-height: 1.5em;
|
||||
margin: 10px 0;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="_form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" runat="server" />
|
||||
<f:Form Width="600px" BodyPadding="5px" ID="Form1" LabelWidth="100px" EnableCollapse="true"
|
||||
runat="server" ShowHeader="false" Title="表单">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Label ID="Label2" CssClass="formtitle x-panel-header-default" runat="server" Text="这是表单标题">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow ColumnWidths="40% 60%">
|
||||
<Items>
|
||||
<f:Label ID="Label1" runat="server" Label="标签" Text="标签的值">
|
||||
</f:Label>
|
||||
<f:CheckBox ID="CheckBox1" runat="server" Text="复选框" Label="复选框">
|
||||
</f:CheckBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow ColumnWidths="40% 60%">
|
||||
<Items>
|
||||
<f:DropDownList ID="DropDownList1" runat="server" Label="下拉列表" EmptyText="请选择一项" Required="true" ShowRedStar="True" AutoSelectFirstItem="false">
|
||||
<f:ListItem Text="可选项 1" Value="0"></f:ListItem>
|
||||
<f:ListItem Text="可选项 2" Value="1"></f:ListItem>
|
||||
</f:DropDownList>
|
||||
<f:TextBox ID="TextBox1" ShowRedStar="true" runat="server" Label="文本框" Required="true"
|
||||
Text="">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar runat="server" Position="Bottom" ToolbarAlign="Center">
|
||||
<Items>
|
||||
<f:Button runat="server" Text="验证此表单并提交" CssClass="mybutton" ValidateForms="Form1"
|
||||
ID="btnSubmitForm1" OnClick="btnSubmitForm1_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnResetForm1" EnablePostBack="false" CssClass="mybutton" Text="重置表单"
|
||||
runat="server">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
28
FineUI.Examples/form/layout_center_label.aspx.cs
Normal file
28
FineUI.Examples/form/layout_center_label.aspx.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUI.Examples.form
|
||||
{
|
||||
public partial class layout_center_label : PageBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
btnResetForm1.OnClientClick = Form1.GetResetReference();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnSubmitForm1_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowNotify("表单验证并提交成功!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
105
FineUI.Examples/form/layout_center_label.aspx.designer.cs
generated
Normal file
105
FineUI.Examples/form/layout_center_label.aspx.designer.cs
generated
Normal file
@ -0,0 +1,105 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUI.Examples.form {
|
||||
|
||||
|
||||
public partial class layout_center_label {
|
||||
|
||||
/// <summary>
|
||||
/// _form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm _form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Form Form1;
|
||||
|
||||
/// <summary>
|
||||
/// Label2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label Label2;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label Label1;
|
||||
|
||||
/// <summary>
|
||||
/// CheckBox1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.CheckBox CheckBox1;
|
||||
|
||||
/// <summary>
|
||||
/// DropDownList1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.DropDownList DropDownList1;
|
||||
|
||||
/// <summary>
|
||||
/// TextBox1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.TextBox TextBox1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSubmitForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button btnSubmitForm1;
|
||||
|
||||
/// <summary>
|
||||
/// btnResetForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button btnResetForm1;
|
||||
}
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head id="Head1" runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="_form1" runat="server">
|
||||
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head id="Head1" runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="_form1" runat="server">
|
||||
|
54
FineUI.Examples/form/layout_multiline_buttons.aspx
Normal file
54
FineUI.Examples/form/layout_multiline_buttons.aspx
Normal file
@ -0,0 +1,54 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="layout_multiline_buttons.aspx.cs"
|
||||
Inherits="FineUI.Examples.form.layout_multiline_buttons" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<form id="_form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" runat="server" />
|
||||
<f:SimpleForm Width="600px" BodyPadding="5px" ID="Form1" LabelWidth="100px" EnableCollapse="true"
|
||||
runat="server" Title="表单">
|
||||
<Items>
|
||||
<f:Label ID="Label1" runat="server" Label="标签" Text="标签的值">
|
||||
</f:Label>
|
||||
<f:CheckBox ID="CheckBox1" runat="server" Text="复选框" Label="复选框">
|
||||
</f:CheckBox>
|
||||
<f:DropDownList ID="DropDownList1" runat="server" Label="下拉列表" EmptyText="请选择一项" Required="true" ShowRedStar="True" AutoSelectFirstItem="false">
|
||||
<f:ListItem Text="可选项 1" Value="0"></f:ListItem>
|
||||
<f:ListItem Text="可选项 2" Value="1"></f:ListItem>
|
||||
</f:DropDownList>
|
||||
<f:TextBox ID="TextBox1" ShowRedStar="true" runat="server" Label="文本框" Required="true"
|
||||
Text="">
|
||||
</f:TextBox>
|
||||
<f:Panel ID="Panel1" runat="server" ShowBorder="false" CssStyle="margin-bottom:5px;" ShowHeader="false">
|
||||
<Items>
|
||||
<f:Button runat="server" CssClass="marginr" Text="按钮一" EnablePostBack="false">
|
||||
</f:Button>
|
||||
<f:Button ID="Button3" runat="server" CssClass="marginr" Text="按钮二" EnablePostBack="false">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel ID="Panel2" runat="server" ShowBorder="false" ShowHeader="false">
|
||||
<Items>
|
||||
<f:Button runat="server" Text="验证此表单并提交" CssClass="marginr" ValidateForms="Form1"
|
||||
ID="Button1" OnClick="btnSubmitForm1_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnReset" EnablePostBack="false" CssClass="marginr" Text="重置表单"
|
||||
runat="server">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
</f:SimpleForm>
|
||||
<br />
|
||||
<br />
|
||||
注:第一行按钮所在的面板设置了样式:CssStyle="margin-bottom:5px;"。
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
28
FineUI.Examples/form/layout_multiline_buttons.aspx.cs
Normal file
28
FineUI.Examples/form/layout_multiline_buttons.aspx.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUI.Examples.form
|
||||
{
|
||||
public partial class layout_multiline_buttons : PageBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
btnReset.OnClientClick = Form1.GetResetReference();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnSubmitForm1_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowNotify("表单验证并提交成功!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
123
FineUI.Examples/form/layout_multiline_buttons.aspx.designer.cs
generated
Normal file
123
FineUI.Examples/form/layout_multiline_buttons.aspx.designer.cs
generated
Normal file
@ -0,0 +1,123 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUI.Examples.form {
|
||||
|
||||
|
||||
public partial class layout_multiline_buttons {
|
||||
|
||||
/// <summary>
|
||||
/// _form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm _form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.SimpleForm Form1;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label Label1;
|
||||
|
||||
/// <summary>
|
||||
/// CheckBox1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.CheckBox CheckBox1;
|
||||
|
||||
/// <summary>
|
||||
/// DropDownList1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.DropDownList DropDownList1;
|
||||
|
||||
/// <summary>
|
||||
/// TextBox1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.TextBox TextBox1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// Button3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button Button3;
|
||||
|
||||
/// <summary>
|
||||
/// Panel2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Panel Panel2;
|
||||
|
||||
/// <summary>
|
||||
/// Button1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button Button1;
|
||||
|
||||
/// <summary>
|
||||
/// btnReset 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button btnReset;
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.btn-in-form
|
||||
{
|
||||
|
79
FineUI.Examples/form/layout_panel_column.aspx
Normal file
79
FineUI.Examples/form/layout_panel_column.aspx
Normal file
@ -0,0 +1,79 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="layout_panel_column.aspx.cs"
|
||||
Inherits="FineUI.Examples.form.layout_panel_column" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="_form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" runat="server" />
|
||||
<f:Form ID="Form1" MessageTarget="Qtip" Width="600px" BodyPadding="5px" Title="表单" runat="server">
|
||||
<items>
|
||||
<f:Panel ID="Panel2" ShowHeader="false" CssClass="formitem" ShowBorder="false"
|
||||
Layout="Column" runat="server">
|
||||
<Items>
|
||||
<f:Label ID="Label2" Width="100px" runat="server" CssClass="marginr" ShowLabel="false"
|
||||
Text="用户名:">
|
||||
</f:Label>
|
||||
<f:TextBox ID="TextBox2" ShowLabel="false" Label="用户名" Required="true" Width="150px" CssClass="marginr" runat="server">
|
||||
</f:TextBox>
|
||||
<f:Button ID="Button3" Text="按钮一" CssClass="marginr" runat="server">
|
||||
</f:Button>
|
||||
<f:Button ID="Button4" Text="按钮二" runat="server">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel ID="Panel1" ShowHeader="false" ShowBorder="false" Layout="Column" CssClass="formitem"
|
||||
runat="server">
|
||||
<Items>
|
||||
<f:Label ID="Label1" runat="server" Width="100px" CssClass="marginr" ShowLabel="false"
|
||||
Text="作息起止时间:">
|
||||
</f:Label>
|
||||
<f:DatePicker ID="DatePicker1" ShowLabel="false" Label="作息开始时间" Required="true" CssClass="marginr" Width="150px" runat="server">
|
||||
</f:DatePicker>
|
||||
<f:DatePicker ID="DatePicker2" ShowLabel="false" Label="作息结束时间" Required="true" CompareControl="DatePicker1" CompareOperator="GreaterThan"
|
||||
CompareMessage="结束日期应该大于开始日期!" Width="150px" runat="server">
|
||||
</f:DatePicker>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel ID="Panel3" ShowHeader="false" ShowBorder="false" Layout="Column" CssClass="formitem"
|
||||
runat="server">
|
||||
<Items>
|
||||
<f:Label ID="Label3" runat="server" Width="100px" CssClass="marginr" ShowLabel="false"
|
||||
Text="上班起止时间:">
|
||||
</f:Label>
|
||||
<f:DatePicker ID="DatePicker3" ShowLabel="false" Label="上班开始时间" Required="true" CssClass="marginr" ColumnWidth="50%" runat="server">
|
||||
</f:DatePicker>
|
||||
<f:DatePicker ID="DatePicker4" ShowLabel="false" Label="上班结束时间" Required="true" CompareControl="DatePicker3" CompareOperator="GreaterThan"
|
||||
CompareMessage="结束日期应该大于开始日期!" ColumnWidth="50%" runat="server">
|
||||
</f:DatePicker>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel ID="Panel4" ShowHeader="false" ShowBorder="false" Layout="Column" CssClass="formitem"
|
||||
runat="server">
|
||||
<Items>
|
||||
<f:Label ID="Label4" runat="server" Width="100px" CssClass="marginr" ShowLabel="false"
|
||||
Text="工作时间:">
|
||||
</f:Label>
|
||||
<f:TextBox Width="40px" ShowLabel="false" Label="工作时间(小时)" Required="true" runat="server">
|
||||
</f:TextBox>
|
||||
<f:Label runat="server" Text=" 小时 ">
|
||||
</f:Label>
|
||||
<f:TextBox Width="40px" ShowLabel="false" Label="工作时间(分钟)" Required="true" ID="TextBox1" runat="server">
|
||||
</f:TextBox>
|
||||
<f:Label ID="Label5" runat="server" Text=" 分钟">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Button ID="Button1" Text="提交表单" ValidateForms="Form1" ValidateMessageBox="true" runat="server">
|
||||
</f:Button>
|
||||
</items>
|
||||
</f:Form>
|
||||
<br />
|
||||
注意:本页面中表单验证失败的错误提示类型是Qtip,而不是默认的Side。
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
23
FineUI.Examples/form/layout_panel_column.aspx.cs
Normal file
23
FineUI.Examples/form/layout_panel_column.aspx.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUI.Examples.form
|
||||
{
|
||||
public partial class layout_panel_column : PageBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void Button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
Alert.Show("表单提交成功");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
204
FineUI.Examples/form/layout_panel_column.aspx.designer.cs
generated
Normal file
204
FineUI.Examples/form/layout_panel_column.aspx.designer.cs
generated
Normal file
@ -0,0 +1,204 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUI.Examples.form {
|
||||
|
||||
|
||||
public partial class layout_panel_column {
|
||||
|
||||
/// <summary>
|
||||
/// _form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm _form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Form Form1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Panel Panel2;
|
||||
|
||||
/// <summary>
|
||||
/// Label2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label Label2;
|
||||
|
||||
/// <summary>
|
||||
/// TextBox2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.TextBox TextBox2;
|
||||
|
||||
/// <summary>
|
||||
/// Button3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button Button3;
|
||||
|
||||
/// <summary>
|
||||
/// Button4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button Button4;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label Label1;
|
||||
|
||||
/// <summary>
|
||||
/// DatePicker1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.DatePicker DatePicker1;
|
||||
|
||||
/// <summary>
|
||||
/// DatePicker2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.DatePicker DatePicker2;
|
||||
|
||||
/// <summary>
|
||||
/// Panel3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Panel Panel3;
|
||||
|
||||
/// <summary>
|
||||
/// Label3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label Label3;
|
||||
|
||||
/// <summary>
|
||||
/// DatePicker3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.DatePicker DatePicker3;
|
||||
|
||||
/// <summary>
|
||||
/// DatePicker4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.DatePicker DatePicker4;
|
||||
|
||||
/// <summary>
|
||||
/// Panel4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Panel Panel4;
|
||||
|
||||
/// <summary>
|
||||
/// Label4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label Label4;
|
||||
|
||||
/// <summary>
|
||||
/// TextBox1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.TextBox TextBox1;
|
||||
|
||||
/// <summary>
|
||||
/// Label5 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label Label5;
|
||||
|
||||
/// <summary>
|
||||
/// Button1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button Button1;
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
@ -75,9 +75,9 @@
|
||||
var list2 = F('<%= RadioButtonList1.ClientID %>');
|
||||
var selectedRadio = list2.getValue();
|
||||
if (Ext.Object.isEmpty(selectedRadio)) {
|
||||
top.F.util.alert("列表一没有选中项!");
|
||||
top.F.alert("列表一没有选中项!");
|
||||
} else {
|
||||
top.F.util.alert("列表一选中项的值:" + selectedRadio[list2.name]);
|
||||
top.F.alert("列表一选中项的值:" + selectedRadio[list2.name]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -23,7 +23,7 @@ namespace FineUI.Examples.grid
|
||||
|
||||
private void BindGrid()
|
||||
{
|
||||
DataTable table = GetDataTable();
|
||||
DataTable table = DataSourceUtil.GetDataTable();
|
||||
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -23,7 +23,7 @@ namespace FineUI.Examples.grid
|
||||
|
||||
private void BindGrid()
|
||||
{
|
||||
DataTable table = GetDataTable();
|
||||
DataTable table = DataSourceUtil.GetDataTable();
|
||||
|
||||
GridView1.DataSource = table;
|
||||
GridView1.DataBind();
|
||||
|
@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -23,7 +23,7 @@ namespace FineUI.Examples.grid
|
||||
|
||||
private void BindGrid()
|
||||
{
|
||||
DataTable table = GetDataTable();
|
||||
DataTable table = DataSourceUtil.GetDataTable();
|
||||
|
||||
GridView1.DataSource = table;
|
||||
GridView1.DataBind();
|
||||
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
/* 分组列的标题靠左显示 */
|
||||
#Group.x-column-header {
|
||||
|
@ -22,7 +22,7 @@ namespace FineUI.Examples.data
|
||||
#region BindGrid
|
||||
private void BindGrid()
|
||||
{
|
||||
DataTable table = GetDataTable();
|
||||
DataTable table = DataSourceUtil.GetDataTable();
|
||||
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -25,7 +25,7 @@ namespace FineUI.Examples.grid
|
||||
|
||||
private void BindGrid()
|
||||
{
|
||||
DataTable table = GetDataTable();
|
||||
DataTable table = DataSourceUtil.GetDataTable();
|
||||
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
|
49
FineUI.Examples/grid/grid_checkall_keepcurrentselection.aspx
Normal file
49
FineUI.Examples/grid/grid_checkall_keepcurrentselection.aspx
Normal file
@ -0,0 +1,49 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="grid_checkall_keepcurrentselection.aspx.cs"
|
||||
Inherits="FineUI.Examples.grid.grid_checkall_keepcurrentselection" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" runat="server" />
|
||||
<f:Grid ID="Grid1" Title="表格" EnableCollapse="true" ShowBorder="true" ShowHeader="true" Width="800px"
|
||||
runat="server" EnableCheckBoxSelect="true" DataKeyNames="Id,Name" KeepCurrentSelection="true">
|
||||
<Columns>
|
||||
<f:RowNumberField />
|
||||
<f:BoundField Width="100px" DataField="Name" DataFormatString="{0}" HeaderText="姓名" />
|
||||
<f:TemplateField Width="80px" HeaderText="性别">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# GetGender(Eval("Gender")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:BoundField Width="80px" DataField="EntranceYear" HeaderText="入学年份" />
|
||||
<f:CheckBoxField Width="80px" RenderAsStaticField="true" DataField="AtSchool" HeaderText="是否在校" />
|
||||
<f:HyperLinkField HeaderText="所学专业" DataToolTipField="Major" DataTextField="Major"
|
||||
DataTextFormatString="{0}" DataNavigateUrlFields="Major" DataNavigateUrlFormatString="http://gsa.ustc.edu.cn/search?q={0}" UrlEncode="true"
|
||||
Target="_blank" ExpandUnusedSpace="True" />
|
||||
<f:ImageField Width="80px" DataImageUrlField="Group" DataImageUrlFormatString="~/res/images/16/{0}.png"
|
||||
HeaderText="分组"></f:ImageField>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
<br />
|
||||
<f:Button ID="Button1" runat="server" CssClass="marginr" Text="选中了哪些行" OnClick="Button1_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="Button2" runat="server" Text="选中第 2, 6, 8 行" OnClick="Button2_Click">
|
||||
</f:Button>
|
||||
<br />
|
||||
<br />
|
||||
<f:Button ID="Button3" runat="server" Text="选中了哪些行(没选择的话不会回发页面)" OnClick="Button1_Click">
|
||||
</f:Button>
|
||||
<br />
|
||||
<f:Label ID="labResult" EncodeText="false" runat="server">
|
||||
</f:Label>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace FineUI.Examples.grid
|
||||
{
|
||||
public partial class grid_checkall_keepcurrentselection : PageBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Button3.OnClientClick = Grid1.GetNoSelectionAlertInTopReference("没有选中项!");
|
||||
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
#region BindGrid
|
||||
|
||||
private void BindGrid()
|
||||
{
|
||||
DataTable table = DataSourceUtil.GetDataTable();
|
||||
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Event
|
||||
|
||||
/// <summary>
|
||||
/// 选中了哪些行
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int[] selections = Grid1.SelectedRowIndexArray;
|
||||
foreach (int rowIndex in selections)
|
||||
{
|
||||
sb.AppendFormat("行号:{0} 用户名:{1}<br />", rowIndex + 1, Grid1.DataKeys[rowIndex][1]);
|
||||
}
|
||||
labResult.Text = sb.ToString();
|
||||
|
||||
//labResult.Text = HowManyRowsAreSelected(Grid1);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 选中第 2, 6, 8 行
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.SelectedRowIndexArray = new int[] { 1, 5, 7 };
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
87
FineUI.Examples/grid/grid_checkall_keepcurrentselection.aspx.designer.cs
generated
Normal file
87
FineUI.Examples/grid/grid_checkall_keepcurrentselection.aspx.designer.cs
generated
Normal file
@ -0,0 +1,87 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUI.Examples.grid {
|
||||
|
||||
|
||||
public partial class grid_checkall_keepcurrentselection {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Label2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label2;
|
||||
|
||||
/// <summary>
|
||||
/// Button1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button Button1;
|
||||
|
||||
/// <summary>
|
||||
/// Button2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button Button2;
|
||||
|
||||
/// <summary>
|
||||
/// Button3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Button Button3;
|
||||
|
||||
/// <summary>
|
||||
/// labResult 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUI.Label labResult;
|
||||
}
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -23,7 +23,7 @@ namespace FineUI.Examples.grid
|
||||
|
||||
private void BindGrid()
|
||||
{
|
||||
DataTable table = GetDataTable();
|
||||
DataTable table = DataSourceUtil.GetDataTable();
|
||||
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
|
@ -6,7 +6,7 @@
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -25,7 +25,7 @@ namespace FineUI.Examples.grid
|
||||
|
||||
private void BindGrid()
|
||||
{
|
||||
DataTable table = GetDataTable();
|
||||
DataTable table = DataSourceUtil.GetDataTable();
|
||||
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -22,7 +22,7 @@ namespace FineUI.Examples.grid
|
||||
|
||||
private void BindGrid()
|
||||
{
|
||||
DataTable table = GetDataTable();
|
||||
DataTable table = DataSourceUtil.GetDataTable();
|
||||
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
@ -34,7 +34,7 @@ namespace FineUI.Examples.grid
|
||||
#region Events
|
||||
|
||||
|
||||
protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
|
||||
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
|
||||
{
|
||||
if (e.CommandName == "Action1" || e.CommandName == "Action2")
|
||||
{
|
||||
|
@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<link href="../res/css/main.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -22,7 +22,7 @@ namespace FineUI.Examples.grid
|
||||
|
||||
private void BindGrid()
|
||||
{
|
||||
DataTable table = GetDataTable();
|
||||
DataTable table = DataSourceUtil.GetDataTable();
|
||||
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
@ -34,7 +34,7 @@ namespace FineUI.Examples.grid
|
||||
#region Events
|
||||
|
||||
|
||||
protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
|
||||
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
|
||||
{
|
||||
if (e.CommandName == "CheckBox1")
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user