首页 新闻 会员 周边 捐助

ext.net如何将空字符串StringEmpty转换成null,SubmitEmptyValue 属性无效

0
悬赏园豆:10 [待解决问题]

1<ext:Store
2 ID="Store1"
3 runat="server"
4 AutoSave="true"
5 ShowWarningOnFailure="false"
6 OnBeforeStoreChanged="HandleChanges"
7 SkipIdForNewRecords="false"
8 RefreshAfterSaving="None">
9 <Reader>
10 <ext:JsonReader IDProperty="Id">
11 <Fields>
12 <ext:RecordField Name="Id" />
13 <ext:RecordField Name="Email" AllowBlank="false" />
14 <ext:RecordField Name="First" AllowBlank="true" SubmitEmptyValue="Null" />
15 <ext:RecordField Name="Last" AllowBlank="true" SubmitEmptyValue="Undefined" />
16 </Fields>
17 </ext:JsonReader>
18 </Reader>
19
20 <Listeners>
21 <Exception Handler="
22 Ext.net.Notification.show({
23 iconCls : 'icon-exclamation',
24 html : e.message,
25 title : 'EXCEPTION',
26 autoScroll : true,
27 hideDelay : 5000,
28 width : 300,
29 height : 200
30 });" />
31 <BeforeSave Handler="var valid = true; this.each(function(r){if(r.dirty && !r.isValid()){valid=false;}}); return valid;" />
32 </Listeners>
33 </ext:Store>
1<ext:FormPanel
2 ID="UserForm"
3 runat="server"
4 Icon="User"
5 Frame="true"
6 LabelAlign="Right"
7 Title="User -- All fields are required"
8 Width="500">
9 <Items>
10 <ext:TextField runat="server"
11 FieldLabel="Email"
12 DataIndex="Email"
13 AllowBlank="false"
14 Vtype="email"
15 AnchorHorizontal="100%"
16 />
17
18 <ext:TextField runat="server"
19 FieldLabel="First"
20 DataIndex="First"
21 AllowBlank="true"
22 AnchorHorizontal="100%"
23 />
24
25 <ext:TextField runat="server"
26 FieldLabel="Last"
27 DataIndex="Last"
28 AllowBlank="true"
29 AnchorHorizontal="100%"
30 />
31 </Items>
32
33 <Buttons>
34 <ext:Button
35 runat="server"
36 Text="Save"
37 Icon="Disk">
38 <Listeners>
39 <Click Handler="updateRecord(#{UserForm});" />
40 </Listeners>
41 </ext:Button>
42
43 <ext:Button
44 runat="server"
45 Text="Create"
46 Icon="UserAdd">
47 <Listeners>
48 <Click Handler="addRecord(#{UserForm}, #{GridPanel1});" />
49 </Listeners>
50 </ext:Button>
51
52 <ext:Button
53 runat="server"
54 Text="Reset">
55 <Listeners>
56 <Click Handler="#{UserForm}.getForm().reset();" />
57 </Listeners>
58 </ext:Button>
59 </Buttons>
60 </ext:FormPanel>

我将

SubmitEmptyValue="Null" 和”Undefined“ 都试过了,当输入空值,也就是TextBox空白的情况后台对应的 First,Last字段的值是StringEmpty,并不是NULL,这让我很头疼,那位大侠做过类似的项目,不知道是否有解决方案。

阿新的主页 阿新 | 初学一级 | 园豆:84
提问于:2011-06-08 20:39
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册