[ExtNet]常见问题汇总--[持续更新]

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/david_520042/article/details/7927418

不断添加中。。。

1.Panel背景色设置成透明

   BodyStyle ="background-color:transparent"

2.label文字着色

   <font color='red'>文字</font>

   小数位数控制

   <ext:NumberField ID="txtDiscountRate" runat="server" FieldLabel="折扣率" Width="150"
     DecimalPrecision="4">
    </ext:NumberField>

3.ORACLE数据库字段

    显示到GP中必须改成大写,才能显示

4.格式化RMB¥100.00

   见:http://blog.csdn.net/david_520042/article/details/7950914

 5.改变tab文字大小的CSS

.x-tab-strip span.x-tab-strip-text
{
 f   ont-size: 12px;
}

加上   #id指定控件CSS

6.Confirm删除新增确认 根据Ext.net 官网 做了修改

第一种

        protected void Cancel(object sender, DirectEventArgs e)
        {
            X.Msg.Confirm("提示", "删除将无法恢复是否确认删除?", new MessageBoxButtonsConfig
            {
                Yes = new MessageBoxButtonConfig
                {
                    Handler = "Ext.net.DirectMethods.Yes()",
                    Text = "确认"     
                },
                No = new MessageBoxButtonConfig
                {
                    Handler = "Ext.net.DirectMethods.No()",
                    Text = "取消"
                }
            }).Show();

        }

         [DirectMethod]
        public void Yes()
        {

        }

  第二种:JS处理:

 

var addbug = function () {
            Ext.Msg.show({
                title: '确认对话框',
                msg: '您确定生成:<br/><<材料(零件)不合格反馈单>>吗?',
                buttons: Ext.Msg.YESNO,
                fn: function (result) {
                    if (result == 'yes') {
                        Ext.net.DirectMethods.AddBug({
                            success: function (result) {

                            },
                            failure: function () {
                                errorMsgShow('生成材料(零件)不合格反馈单失败,请与管理员联系!')
                            }

                        });
                    }

                },
                icon: Ext.MessageBox.QUESTION
            });
        }

   第三种: Before="return confirm('你确认要删除?');"

   第四种:

<click>
<confirm></confirm>
</click>

7.前台验证不允许为空

    

                                      <ext:Button ID="btnSave" runat="server" Text="保存" Icon="Accept">
                                       <Listeners>
                                          <Click Handler="
                                                    if(!#{txtItem}.validate()||!#{txtUnit}.validate()||!#{cbxWareHouse}.validate()){
                                                      Ext.Msg.alert('友情提示','品号|库存单位|主要仓库不能为空');
                                                      return false;
                                                    }
                                          " />
                                       </Listeners>
                                        <DirectEvents>
                                            <Click OnEvent="btnSave_Click">
                                                <EventMask ShowMask="true" Msg="保存..." MinDelay="500" />
                                            </Click>
                                        </DirectEvents>
                                    </ext:Button>


 

8.后台处理:首行 上一行  下一行 尾行

       

 #region 首行 上一行 下一行 尾行
        public void First(object o,DirectEventArgs e) 
        {
            RowSelectionModel sm = this.ItemGrid.SelectionModel.Primary as RowSelectionModel;
            sm.SelectFirstRow();
        }
        public void Previous(object o, DirectEventArgs e) 
        {
            RowSelectionModel sm = this.ItemGrid.SelectionModel.Primary as RowSelectionModel;
            sm.SelectPrevious();
        }
        public void Next(object o, DirectEventArgs e)
        {
            RowSelectionModel sm = this.ItemGrid.SelectionModel.Primary as RowSelectionModel;
            sm.SelectNext();
        }
        public void Last(object o, DirectEventArgs e)
        {
            RowSelectionModel sm = this.ItemGrid.SelectionModel.Primary as RowSelectionModel;
            sm.SelectLastRow();
        }
        #endregion


JS处理方式。。

   

<ext:Button ID="btnFirst" runat="server" Text="首行" Icon="ResultsetFirst">
                                        <Listeners>
                                            <Click Handler="ItemGrid.getSelectionModel().selectFirstRow();getData();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="btnPrevious" runat="server" Text="上一行" Icon="ResultsetPrevious">
                                        <Listeners>
                                            <Click Handler="ItemGrid.getSelectionModel().selectPrevious();getData();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="btnNext" runat="server" Text="下一行" Icon="ResultsetNext">
                                        <Listeners>
                                            <Click Handler="ItemGrid.getSelectionModel().selectNext();getData();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="btnLast" runat="server" Text="尾行" Icon="ResultsetLast">
                                        <Listeners>
                                            <Click Handler="ItemGrid.getSelectionModel().selectLastRow();getData();" />
                                        </Listeners>
                                    </ext:Button>

9.Grid 固定高度,根据行自动增加高度。

-MaxHeight="550" AutoScroll="true"  AutoDoLayout="true"

10.tabpanel 激活

TabPanel1.ActiveTabIndex = 1;

11.网格添加线

     .x-grid3-cell-inner
        {
            border-right: 1px solid #dadada;
            white-space: normal !important;
        }
        .x-grid3-row td, .x-grid3-summary-row td
        {
            padding-right: 0px;
        }
        .x-grid3-hd-row td
        {
            border-left: 0px solid;
        }

 

 12.简易工具栏效果:

 

<TopBar>
                            <ext:Toolbar ID="Toolbar1" runat="server">
                                <Items>
                                    <ext:Button ID="btnAdd" runat="server" Text="添加" Icon="DatabaseAdd">
                                        <Listeners>
                                            <Click Handler="Ext.net.DirectMethods.ItemClick('Add');" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="btnQuery" runat="server" Text="查询" Icon="Zoom">
                                        <Listeners>
                                            <Click Handler="#{WinCondition}.show();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="btnEdit" runat="server" Text="修改" Icon="DatabaseEdit">
                                        <Listeners>
                                            <Click Handler="Ext.net.DirectMethods.ItemClick('Edit');" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="btnDel" runat="server" Text="删除" Icon="DatabaseDelete">
                                        <DirectEvents>
                                            <Click OnEvent="Delete">
                                            </Click>
                                        </DirectEvents>
                                    </ext:Button>
                                    <ext:ToolbarSeparator ID="ToolbarSeparator6" runat="server">
                                    </ext:ToolbarSeparator>
                                    <ext:Button ID="btnSave" runat="server" Text="保存" Icon="Accept">
                                        <Listeners>
                                            <Click Handler="
                                            if (#{fpbasic}.getForm().isValid()){ 
                                                Ext.net.DirectMethods.Save_Click();
                                            } else{
                                                Ext.Msg.show({icon: Ext.MessageBox.ERROR, msg: '必添项输入不完整', buttons:Ext.Msg.OK
                                                });
                                            }
                                            " />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="btnCancel" runat="server" Text="取消" Icon="Cancel">
                                        <DirectEvents>
                                            <Click OnEvent="Cancel">
                                            </Click>
                                        </DirectEvents>
                                    </ext:Button>
                                    <ext:Button ID="btnCheck" runat="server" Text="审核" Icon="AwardStarAdd">
                                        <DirectEvents>
                                            <Click OnEvent="Check">
                                            </Click>
                                        </DirectEvents>
                                    </ext:Button>
                                    <ext:Button ID="btnUnCheck" runat="server" Text="撤审" Icon="AwardStarSilver1">
                                        <DirectEvents>
                                            <Click OnEvent="UnCheck">
                                            </Click>
                                        </DirectEvents>
                                    </ext:Button>
                                    <ext:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
                                    </ext:ToolbarSeparator>
                                    <ext:Button ID="btnFirst" runat="server" Text="首行" Icon="ResultsetFirst">
                                        <Listeners>
                                            <Click Handler="ItemGrid.getSelectionModel().selectFirstRow();getData();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="btnPrevious" runat="server" Text="上一行" Icon="ResultsetPrevious">
                                        <Listeners>
                                            <Click Handler="ItemGrid.getSelectionModel().selectPrevious();getData();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="btnNext" runat="server" Text="下一行" Icon="ResultsetNext">
                                        <Listeners>
                                            <Click Handler="ItemGrid.getSelectionModel().selectNext();getData();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="btnLast" runat="server" Text="尾行" Icon="ResultsetLast">
                                        <Listeners>
                                            <Click Handler="ItemGrid.getSelectionModel().selectLastRow();getData();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarSeparator ID="ToolbarSeparator3" runat="server">
                                    </ext:ToolbarSeparator>
                                    <ext:Button ID="btnDealWith" runat="server" Text="不合格品处置" Icon="BugGo">
                                        <DirectEvents>
                                            <Click OnEvent="MaoyiEdit">
                                            </Click>
                                        </DirectEvents>
                                    </ext:Button>
                                    <ext:Button ID="btnvendorsa" runat="server" Text="供应商分析及纠正措施" Icon="BugLink">
                                        <DirectEvents>
                                            
                                        </DirectEvents>
                                    </ext:Button>
                                    <ext:SplitButton ID="SplitButton1" runat="server" Text="异常报表管理"  Icon="Report">
                                        <Menu>
                                            <ext:Menu ID="Menu1" runat="server">
                                                <Items>
                                                    <ext:MenuItem ID="MenuItem1" runat="server" Text="打印出货标签"  Icon="PrinterAdd"/>
                                                    <ext:MenuItem ID="MenuItem2" runat="server" Text="打印异常报告单"  Icon="Printer"/>
                                                </Items>
                                            </ext:Menu>
                                        </Menu>
                                    </ext:SplitButton>
                                    <ext:ToolbarSeparator ID="ToolbarSeparator4" runat="server">
                                    </ext:ToolbarSeparator>
                                    <ext:Button ID="btnRefresh" runat="server" Text="刷新" Icon="ArrowRefresh">
                                        <Listeners>
                                            <Click Handler="location.reload(); " />
                                        </Listeners>
                                    </ext:Button>
                                    
                                </Items>
                            </ext:Toolbar>
                        </TopBar>

13.打开新连接:

直接触发

        var vendorsa = function () {
            var id = Ext.getCmp("txtId").getValue();
            if (id == "") {
                alert("请选择一条记录!");
            }
            window.open('ZEIQCVendorFeedBack.aspx');
        }
function openwin(w, h, url) {
            var l = (window.screen.width / 2) - w / 2;
            var t = (window.screen.height / 2) - h / 2;
            window.open(url, '', 'width=' + w + ',height=' + h + ',top=' + t + ',left=' + l + ',menubar=no,toobar=no,scrollbars=yes,resizable=no,status=no,loation=no');
        }

Grid渲染:

function Details(v) {
            var temp = '<a href="ZMQuoAdd.aspx?SerialNo={0}" target="_self">{0}</a>';
            return String.format(temp, v);
        };





 

没有更多推荐了,返回首页