前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Ext.net RecordField SubmitEmptyValue invalid 无效问题有解决方案吗

Ext.net RecordField SubmitEmptyValue invalid 无效问题有解决方案吗

作者头像
阿新
发布2018-04-12 16:06:13
6700
发布2018-04-12 16:06:13
举报
文章被收录于专栏:c#开发者c#开发者
代码语言:javascript
复制
<ext:Store 
            ID="Store1" 
            runat="server" 
            AutoSave="true" 
            ShowWarningOnFailure="false"
            OnBeforeStoreChanged="HandleChanges" 
            SkipIdForNewRecords="false"
            RefreshAfterSaving="None">
            <Reader>
                <ext:JsonReader IDProperty="Id">
                    <Fields>
                        <ext:RecordField Name="Id" />
                        <ext:RecordField Name="Email" AllowBlank="false" />
                        <ext:RecordField Name="First" AllowBlank="true" SubmitEmptyValue="Null" />
                        <ext:RecordField Name="Last" AllowBlank="true" SubmitEmptyValue="Undefined" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
            
            <Listeners>
                <Exception Handler="
                    Ext.net.Notification.show({
                        iconCls    : 'icon-exclamation', 
                        html       : e.message, 
                        title      : 'EXCEPTION', 
                        autoScroll : true, 
                        hideDelay  : 5000, 
                        width      : 300, 
                        height     : 200
                    });" />
                <BeforeSave Handler="var valid = true; this.each(function(r){if(r.dirty && !r.isValid()){valid=false;}}); return valid;" />
            </Listeners>
        </ext:Store>  <ext:FormPanel             ID="UserForm" 
            runat="server"
            Icon="User"
            Frame="true"
            LabelAlign="Right"
            Title="User -- All fields are required"
            Width="500">
            <Items>
                <ext:TextField runat="server"
                    FieldLabel="Email"
                    DataIndex="Email"
                    AllowBlank="false"
                    Vtype="email"
                    AnchorHorizontal="100%"
                    />
                
                <ext:TextField runat="server"
                    FieldLabel="First"
                    DataIndex="First"
                    AllowBlank="true"
                    AnchorHorizontal="100%"
                    />
                
                <ext:TextField runat="server"
                    FieldLabel="Last"
                    DataIndex="Last"
                    AllowBlank="true"
                    AnchorHorizontal="100%"
                    />
            </Items>
            
            <Buttons>
                <ext:Button 
                    runat="server"
                    Text="Save"
                    Icon="Disk">
                    <Listeners>
                        <Click Handler="updateRecord(#{UserForm});" />
                    </Listeners>
                </ext:Button>
                
                <ext:Button 
                    runat="server"
                    Text="Create"
                    Icon="UserAdd">
                    <Listeners>
                        <Click Handler="addRecord(#{UserForm}, #{GridPanel1});" />
                    </Listeners>
                </ext:Button>
                
                <ext:Button 
                    runat="server"
                    Text="Reset">
                    <Listeners>
                        <Click Handler="#{UserForm}.getForm().reset();" />
                    </Listeners>
                </ext:Button>
            </Buttons>
        </ext:FormPanel> 我将SubmitEmptyValue="Null" 和”Undefined“ 都试过了,当输入空值,也就是TextBox空白的情况后台对应的 First,Last字段的值是StringEmpty,并不是NULL,这让我很头疼,那位大侠做过类似的项目,不知道是否有解决方案。
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2011-06-08 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档