A:想要實現DEMO中的左側點擊樹,在右側打開怎麼作
Q:下載此示例 EmptyProjectNet40_FineUI_v3.3.1.1.rar (1.28 MB, 下載次數: 22)
A:下載的DEMO運行提示Ext未定義怎麼辦
Q:下載extjs,放到項目根目錄,傳送門http://fineui.com/bbs/forum.php?mod=viewthread&tid=3218
A:搭建項目總是出錯怎麼辦
Q:下載空項目,傳送門>>http://fineui.com/bbs/forum.php?mod=viewthread&tid=2123
A:fineui中 Js怎麼打開window
Q:代碼示例:X("WindowID").box_show("/Trust/Accept.aspx?ID=12","受理委託");
A:我想Alert.Show("保存成功");後關閉window如何作啊
Q:PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference() + Alert.GetShowInParentReference("保存成功!"));
A:DorpDownList支持多選嗎
Q:不支持
A:Formrow之間的行距過小,如何增寬一點
Q:在頁面中加入CSS
.x-form-item {margin-bottom: 8px;}
A:Grid控件,某行某個字段值知足必定條件時,該字段值變紅
Q:用TemplateField<ext:TemplateField>
<itemTemplate>
<%# WrapColor(Eval("studentStatus"),"休學","red")%>
後臺
protected string WrapColor(object value,string condition,string color){
var val = value.ToString();
return string.format("<span style='color:{1}'>{0}</span>",val,val==condition?color:"");
}
其它小技巧:
Grid單元格換行
.x-grid-tpl,.ext-ie .x-grid3-cell-inner, .ext-ie .x-grid3-hd-inner {
white-space: normal;
}
Grid模板列內容行距
.x-grid-tpl {
line-height: 22px;
}
Grid行高
.x-grid3-row-table tr{ height: 25px;}
Grid分頁工具條上的合計及字體調整
C#代碼:
var list = bEmployee.GetList(page + 1, GridList.PageSize, where.ToString(), out total);
lblSum.Text = list.Sum(p=>p.DebtNeed).ToString("0.00");
設計代碼:
<PageItems>
<ext:Label runat="server" Text="未收款合計:" CssStyle="margin-left:100px;"></ext:Label>
<ext:Label runat="server" ID="lblSum" Text="0.00" CssClass="sum"></ext:Label>
</PageItems>
CSS:
.sum span{
font-weight: bold !important;
font-size: 14px !important;
color: red !important;
}
Form輸入控件提示的字體大小調整
.x-tip .x-tip-body{ font-size: 12px;}
Toolbar中的文本框響應回車執行查詢
設計代碼:
<ext:Toolbar ID="Toolbar1" runat="server" Position="Top">
<Items>
<ext:TextBox ID="txtProjectName" runat="server" EmptyText="工程名稱查詢.."></ext:TextBox>
<ext:ToolbarSeparator ID="ToolbarSeparator2" runat="server"></ext:ToolbarSeparator>
<ext:Button ID="btnSearch" runat="server" Icon="SystemSearch" Text="查詢"></ext:Button>
</Items>
</ext:Toolbar>
JS腳本:
<script>
function onReady() {
var txtProjectName = Ext.getCmp('<%=txtProjectName.ClientID %>');
txtProjectName.on('specialkey', function (box, e) {
if (e.getKey() == e.ENTER) doSearch();
});
function doSearch() {
//觸發btnSearch的單擊事件,執行查詢
X.disable('<%=btnSearch.ClientID %>');
__doPostBack('<%=btnSearch.UniqueID %>', '');
}
}
</script>
C#代碼
protected void BtnSearchClick(object sender, EventArgs e)
{
BindGrid(0);
}
private void BindGrid(int page)
{
int total;
var projectName = txtProjectName.Text;
var list = bTrust.GetList(page + 1, GridList.PageSize, projectName, out total);
GridList.DataSource = list;
GridList.RecordCount = total;
GridList.PageIndex = page;
GridList.DataBind();
}
防止在readonly的文本框中按backspace鍵回到歷史頁面
function onReady() {
//做用於Firefox、Opera
document.onkeypress=banBackSpace;
//做用於IE、Chrome
document.onkeydown=banBackSpace;
}
//處理鍵盤事件 禁止後退鍵(Backspace)密碼或單行、多行文本框除外
function banBackSpace(e){
var ev = e || window.event;
var obj = ev.target || ev.srcElement;
var t = obj.type || obj.getAttribute('type');
var vReadOnly = obj.readOnly;
var vDisabled = obj.disabled;
vReadOnly = (vReadOnly == undefined) ? false : vReadOnly;
vDisabled = (vDisabled == undefined) ? true : vDisabled;
var flag1= ev.keyCode == 8 && (t=="password" || t=="text" || t=="textarea")&& (vReadOnly==true || vDisabled==true);
var flag2 = ev.keyCode == 8 && t != "password" && t != "text" && t != "textarea";
if(flag2 || flag1)return false;
}php