forked from extnet/Ext.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFieldContainerBase.cs
More file actions
991 lines (926 loc) · 32.8 KB
/
FieldContainerBase.cs
File metadata and controls
991 lines (926 loc) · 32.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
/********
* @version : 2.1.1 - Ext.NET Pro License
* @author : Ext.NET, Inc. http://www.ext.net/
* @date : 2012-12-10
* @copyright : Copyright (c) 2007-2012, Ext.NET, Inc. (http://www.ext.net/). All rights reserved.
* @license : See license.txt and http://www.ext.net/license/.
********/
using System.Collections.Generic;
using System.ComponentModel;
using System.Web.UI;
namespace Ext.Net
{
/// <summary>
///
/// </summary>
[Meta]
public abstract partial class FieldContainerBase : AbstractContainer, IIcon
{
/// <summary>
/// If set to true, the field container will automatically combine and display the validation errors from all the fields it contains as a single error on the container, according to the configured msgTarget. Defaults to false.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. FieldContainer")]
[DefaultValue(false)]
[NotifyParentProperty(true)]
[Description("If set to true, the field container will automatically combine and display the validation errors from all the fields it contains as a single error on the container, according to the configured msgTarget. Defaults to false.")]
public virtual bool CombineErrors
{
get
{
return this.State.Get<bool>("CombineErrors", false);
}
set
{
this.State.Set("CombineErrors", value);
}
}
/// <summary>
/// If set to true, and there is no defined fieldLabel, the field container will automatically generate its label by combining the labels of all the fields it contains. Defaults to false.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. FieldContainer")]
[DefaultValue(false)]
[NotifyParentProperty(true)]
[Description("If set to true, and there is no defined fieldLabel, the field container will automatically generate its label by combining the labels of all the fields it contains. Defaults to false.")]
public virtual bool CombineLabels
{
get
{
return this.State.Get<bool>("CombineLabels", false);
}
set
{
this.State.Set("CombineLabels", value);
}
}
/// <summary>
/// The string to use when joining the labels of individual sub-fields, when combineLabels is set to true. Defaults to ', '.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. FieldContainer")]
[DefaultValue(", ")]
[NotifyParentProperty(true)]
[Description("The string to use when joining the labels of individual sub-fields, when combineLabels is set to true. Defaults to ', '.")]
public virtual string LabelConnector
{
get
{
return this.State.Get<string>("LabelConnector", ", ");
}
set
{
this.State.Set("LabelConnector", value);
}
}
private Labelable fieldDefaults;
/// <summary>
/// If specified, the properties in this object are used as default config values for each Ext.form.Labelable instance (e.g. Ext.form.field.Base or Ext.form.FieldContainer) that is added as a descendant of this container. Corresponding values specified in an individual field's own configuration, or from the defaults config of its parent container, will take precedence. See the documentation for Ext.form.Labelable to see what config options may be specified in the fieldDefaults.
/// </summary>
[Meta]
[ConfigOption(JsonMode.Object)]
[Category("6. FieldContainer")]
[NotifyParentProperty(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
[Description("If specified, the properties in this object are used as default config values for each Ext.form.Labelable instance (e.g. Ext.form.field.Base or Ext.form.FieldContainer) that is added as a descendant of this container. Corresponding values specified in an individual field's own configuration, or from the defaults config of its parent container, will take precedence. See the documentation for Ext.form.Labelable to see what config options may be specified in the fieldDefaults.")]
public virtual Labelable FieldDefaults
{
get
{
if (this.fieldDefaults == null)
{
this.fieldDefaults = new Labelable(this);
}
return this.fieldDefaults;
}
}
#region Ext.form.Labelable
/// <summary>
/// If specified, then the component will be displayed with this value as its active error when first rendered. Defaults to undefined. Use setActiveError or unsetActiveError to change it after component creation.
/// </summary>
[Meta]
[ConfigOption]
[DirectEventUpdate(MethodName = "SetActiveError")]
[Category("5. Field")]
[DefaultValue(null)]
[Description("If specified, then the component will be displayed with this value as its active error when first rendered. Defaults to undefined. Use setActiveError or unsetActiveError to change it after component creation.")]
public virtual string ActiveError
{
get
{
return this.State.Get<string>("ActiveError", null);
}
set
{
this.State.Set("ActiveError", value);
}
}
private XTemplate activeErrorsTpl;
/// <summary>
/// The template used to format the Array of error messages passed to setActiveErrors into a single HTML string. By default this renders each message as an item in an unordered list.
///
/// Standard template:
/// <code>
/// '<tpl if="errors && errors.length">',
/// '<ul><tpl for="errors"><li<tpl if="xindex == xcount"> class="last"</tpl>>{.}</li></tpl></ul>',
/// '</tpl>'
/// </code>
/// </summary>
[Meta]
[Category("5. Field")]
[ConfigOption("activeErrorsTpl", typeof(LazyControlJsonConverter))]
[PersistenceMode(PersistenceMode.InnerProperty)]
[Description("The template used to format the Array of error messages passed to setActiveErrors into a single HTML string. By default this renders each message as an item in an unordered list.")]
public virtual XTemplate ActiveErrorsTpl
{
get
{
return this.activeErrorsTpl;
}
set
{
if (this.activeErrorsTpl != null)
{
this.Controls.Remove(this.activeErrorsTpl);
this.LazyItems.Remove(this.activeErrorsTpl);
}
this.activeErrorsTpl = value;
if (this.activeErrorsTpl != null)
{
this.activeErrorsTpl.EnableViewState = false;
this.Controls.Add(this.activeErrorsTpl);
this.LazyItems.Add(this.activeErrorsTpl);
}
}
}
/// <summary>
/// Whether to adjust the component's body area to make room for 'side' or 'under' error messages. Defaults to true.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue(true)]
[Description("Whether to adjust the component's body area to make room for 'side' or 'under' error messages. Defaults to true.")]
public virtual bool AutoFitErrors
{
get
{
return this.State.Get<bool>("AutoFitErrors", true);
}
set
{
this.State.Set("AutoFitErrors", value);
}
}
/// <summary>
/// The CSS class to be applied to the body content element. Defaults to 'x-form-item-body'.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue("x-form-item-body")]
[Description("The CSS class to be applied to the body content element. Defaults to 'x-form-item-body'.")]
public virtual string BaseBodyCls
{
get
{
return this.State.Get<string>("BaseBodyCls", "x-form-item-body");
}
set
{
this.State.Set("BaseBodyCls", value);
}
}
/// <summary>
/// The CSS class used to to apply to the special clearing div rendered directly after each form field wrapper to provide field clearing (defaults to 'x-form-clear-left').
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue("x-clear")]
[Description("The CSS class used to to apply to the special clearing div rendered directly after each form field wrapper to provide field clearing (defaults to 'x-form-clear-left').")]
public virtual string ClearCls
{
get
{
return this.State.Get<string>("ClearCls", "x-clear");
}
set
{
this.State.Set("ClearCls", value);
}
}
/// <summary>
/// The CSS class to be applied to the error message element. Defaults to 'x-form-error-msg'.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue("x-form-error-msg")]
[Description("The CSS class to be applied to the error message element. Defaults to 'x-form-error-msg'.")]
public virtual string ErrorMsgCls
{
get
{
return this.State.Get<string>("ErrorMsgCls", "x-form-error-msg");
}
set
{
this.State.Set("ErrorMsgCls", value);
}
}
/// <summary>
/// An extra CSS class to be applied to the body content element in addition to fieldBodyCls. Defaults to empty.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue("")]
[Description("An extra CSS class to be applied to the body content element in addition to fieldBodyCls. Defaults to empty.")]
public virtual string FieldBodyCls
{
get
{
return this.State.Get<string>("FieldBodyCls", "");
}
set
{
this.State.Set("FieldBodyCls", value);
}
}
/// <summary>
/// The label for the field. It gets appended with the labelSeparator, and its position and sizing is determined by the labelAlign, labelWidth, and labelPad configs. Defaults to undefined.
/// </summary>
[Meta]
[ConfigOption]
[DirectEventUpdate(MethodName = "SetFieldLabel")]
[Category("5. Field")]
[DefaultValue("")]
[Localizable(true)]
[Description("The label for the field. It gets appended with the labelSeparator, and its position and sizing is determined by the labelAlign, labelWidth, and labelPad configs. Defaults to undefined.")]
public virtual string FieldLabel
{
get
{
return this.State.Get<string>("FieldLabel", "");
}
set
{
this.State.Set("FieldLabel", value);
}
}
/// <summary>
/// A CSS class to be applied to the outermost element to denote that it is participating in the form field layout. Defaults to 'x-form-item'.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue("x-form-item")]
[Description("A CSS class to be applied to the outermost element to denote that it is participating in the form field layout. Defaults to 'x-form-item'.")]
public virtual string FormItemCls
{
get
{
return this.State.Get<string>("FormItemCls", "x-form-item");
}
set
{
this.State.Set("FormItemCls", value);
}
}
/// <summary>
/// When set to true, the label element (fieldLabel and labelSeparator) will be automatically hidden if the fieldLabel is empty. Setting this to false will cause the empty label element to be rendered and space to be reserved for it; this is useful if you want a field without a label to line up with other labeled fields in the same form. Defaults to true.
///
/// If you wish to unconditionall hide the label even if a non-empty fieldLabel is configured, then set the hideLabel config to true.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue(true)]
[Description(" When set to true, the label element (fieldLabel and labelSeparator) will be automatically hidden if the fieldLabel is empty.")]
public virtual bool HideEmptyLabel
{
get
{
return this.State.Get<bool>("HideEmptyLabel", true);
}
set
{
this.State.Set("HideEmptyLabel", value);
}
}
/// <summary>
/// Set to true to completely hide the label element (fieldLabel and labelSeparator). Defaults to false.
///
/// Also see hideEmptyLabel, which controls whether space will be reserved for an empty fieldLabel.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue(false)]
[Description("Set to true to completely hide the label element (fieldLabel and labelSeparator). Defaults to false.")]
public virtual bool HideLabel
{
get
{
return this.State.Get<bool>("HideLabel", false);
}
set
{
this.State.Set("HideLabel", value);
}
}
/// <summary>
/// The CSS class to use when marking the component invalid (defaults to 'x-form-invalid')
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue("x-form-invalid")]
[Description("The CSS class to use when marking the component invalid (defaults to 'x-form-invalid')")]
public virtual string InvalidCls
{
get
{
return this.State.Get<string>("InvalidCls", "x-form-invalid");
}
set
{
this.State.Set("InvalidCls", value);
}
}
/// <summary>
/// Controls the position and alignment of the fieldLabel. Valid values are:
/// "left" (the default) - The label is positioned to the left of the field, with its text aligned to the left. Its width is determined by the labelWidth config.
/// "top" - The label is positioned above the field.
/// "right" - The label is positioned to the left of the field, with its text aligned to the right. Its width is determined by the labelWidth config.
/// </summary>
[Meta]
[ConfigOption(JsonMode.ToLower)]
[Category("5. Field")]
[DefaultValue(LabelAlign.Left)]
[NotifyParentProperty(true)]
[Description("Controls the position and alignment of the fieldLabel.")]
public virtual LabelAlign LabelAlign
{
get
{
return this.State.Get<LabelAlign>("LabelAlign", LabelAlign.Left);
}
set
{
this.State.Set("LabelAlign", value);
}
}
/// <summary>
/// The CSS class to be applied to the label element. Defaults to 'x-form-item-label'. This (single) CSS class is used to formulate the renderSelector and drives the field layout where it is concatenated with a hyphen ('-') and labelAlign. To add additional classes, use labelClsExtra.
/// </summary>
[Meta]
[ConfigOption("labelClsExtra")]
[Category("5. Field")]
[DefaultValue("")]
[Description("The CSS class to be applied to the label element.")]
public virtual string LabelCls
{
get
{
return this.State.Get<string>("LabelCls", "");
}
set
{
this.State.Set("LabelCls", value);
}
}
/// <summary>
/// The amount of space in pixels between the fieldLabel and the input field. Defaults to 5.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue(5)]
[NotifyParentProperty(true)]
[Description("The amount of space in pixels between the fieldLabel and the input field. Defaults to 5.")]
public virtual int LabelPad
{
get
{
return this.State.Get<int>("LabelPad", 5);
}
set
{
this.State.Set("LabelPad", value);
}
}
/// <summary>
/// Character(s) to be inserted at the end of the label text.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue(":")]
[Description("Character(s) to be inserted at the end of the label text.")]
public virtual string LabelSeparator
{
get
{
return this.State.Get<string>("LabelSeparator", ":");
}
set
{
this.State.Set("LabelSeparator", value);
}
}
/// <summary>
/// A CSS style specification string to apply directly to this field's label. Defaults to undefined.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue("")]
[Description("A CSS style specification string to apply directly to this field's label. Defaults to undefined.")]
public virtual string LabelStyle
{
get
{
return this.State.Get<string>("LabelStyle", "");
}
set
{
this.State.Set("LabelStyle", value);
}
}
/// <summary>
/// The width of the fieldLabel in pixels. Only applicable if the labelAlign is set to "left" or "right". Defaults to 100.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue(100)]
[NotifyParentProperty(true)]
[Description("The width of the fieldLabel in pixels. Only applicable if the labelAlign is set to \"left\" or \"right\". Defaults to 100.")]
public virtual int LabelWidth
{
get
{
return this.State.Get<int>("LabelWidth", 100);
}
set
{
this.State.Set("LabelWidth", value);
}
}
/// <summary>
/// The location where the error message text should display. Must be one of the following values:
///
/// qtip Display a quick tip containing the message when the user hovers over the field. This is the default.
/// title Display the message in a default browser title attribute popup.
/// under Add a block div beneath the field containing the error message.
/// side Add an error icon to the right of the field, displaying the message in a popup on hover.
/// none Don't display any error message. This might be useful if you are implementing custom error display.
/// [element id] Add the error message directly to the innerHTML of the specified element.
/// </summary>
[Meta]
[ConfigOption(JsonMode.ToLower)]
[Category("5. Field")]
[TypeConverter(typeof(MessageTarget))]
[DefaultValue(MessageTarget.Qtip)]
[Description("The location where the error message text should display.")]
public virtual MessageTarget MsgTarget
{
get
{
return this.State.Get<MessageTarget>("MsgTarget", MessageTarget.Qtip);
}
set
{
this.State.Set("MsgTarget", value);
}
}
/// <summary>
/// Add the error message directly to the innerHTML of the specified element.
/// </summary>
[Meta]
[ConfigOption("msgTarget")]
[Category("5. Field")]
[DefaultValue("")]
[Description("Add the error message directly to the innerHTML of the specified element.")]
public virtual string MsgTargetElement
{
get
{
return this.State.Get<string>("MsgTargetElement", "");
}
set
{
this.State.Set("MsgTargetElement", value);
}
}
/// <summary>
/// true to disable displaying any error message set on this object. Defaults to false.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue(false)]
[Description("true to disable displaying any error message set on this object. Defaults to false.")]
public virtual bool PreventMark
{
get
{
return this.State.Get<bool>("PreventMark", false);
}
set
{
this.State.Set("PreventMark", value);
}
}
/// <summary>
/// Preserve indicator icon place. Defaults to false
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue(false)]
[Description("Preserve indicator icon place. Defaults to false")]
public virtual bool PreserveIndicatorIcon
{
get
{
return this.State.Get<bool>("PreserveIndicatorIcon", false);
}
set
{
this.State.Set("PreserveIndicatorIcon", value);
}
}
/// <summary>
/// The indicator text.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue("")]
[DirectEventUpdate(MethodName = "SetIndicatorText")]
[Description("The indicator text.")]
public virtual string IndicatorText
{
get
{
return this.State.Get<string>("IndicatorText", "");
}
set
{
this.State.Set("IndicatorText", value);
}
}
/// <summary>
/// The indicator css class.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue("")]
[DirectEventUpdate(MethodName = "SetIndicatorCls")]
[Description("The indicator css class.")]
public virtual string IndicatorCls
{
get
{
return this.State.Get<string>("IndicatorCls", "");
}
set
{
this.State.Set("IndicatorCls", value);
}
}
/// <summary>
/// The indicator icon class.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue("")]
[DirectEventUpdate(MethodName = "SetIndicatorIconCls")]
[Description("The indicator icon class.")]
public virtual string IndicatorIconCls
{
get
{
return this.State.Get<string>("IndicatorIconCls", "");
}
set
{
this.State.Set("IndicatorIconCls", value);
}
}
/// <summary>
///
/// </summary>
[Meta]
[Category("5. Field")]
[DefaultValue(Icon.None)]
[DirectEventUpdate(MethodName = "SetIndicatorIconCls")]
[Description("")]
public virtual Icon IndicatorIcon
{
get
{
return this.State.Get<Icon>("IndicatorIcon", Icon.None);
}
set
{
this.State.Set("IndicatorIcon", value);
}
}
/// <summary>
///
/// </summary>
[ConfigOption("indicatorIconCls")]
[DefaultValue("")]
[Description("")]
protected virtual string IndicatorIconClsProxy
{
get
{
if (this.IndicatorIcon != Icon.None)
{
return "#" + this.IndicatorIcon.ToString();
}
return this.IndicatorIconCls;
}
}
/// <summary>
/// The indicator tip.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue("")]
[DirectEventUpdate(MethodName = "SetIndicatorTip")]
[Description("The indicator tip.")]
public virtual string IndicatorTip
{
get
{
return this.State.Get<string>("IndicatorTip", "");
}
set
{
this.State.Set("IndicatorTip", value);
}
}
/// <summary>
/// The note.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue("")]
[DirectEventUpdate(MethodName = "SetNote")]
[Description("The note.")]
public virtual string Note
{
get
{
return this.State.Get<string>("Note", "");
}
set
{
this.State.Set("Note", value);
}
}
/// <summary>
/// The note css class.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue("")]
[DirectEventUpdate(MethodName = "SetNoteCls")]
[Description("The note css class.")]
public virtual string NoteCls
{
get
{
return this.State.Get<string>("NoteCls", "");
}
set
{
this.State.Set("NoteCls", value);
}
}
/// <summary>
/// Note align
/// </summary>
[Meta]
[ConfigOption(JsonMode.ToLower)]
[Category("5. Field")]
[DefaultValue(NoteAlign.Down)]
[Description("Note align")]
public virtual NoteAlign NoteAlign
{
get
{
return this.State.Get<NoteAlign>("NoteAlign", NoteAlign.Down);
}
set
{
this.State.Set("NoteAlign", value);
}
}
/// <summary>
/// True to encode note text
/// </summary>
[Meta]
[ConfigOption]
[Category("5. Field")]
[DefaultValue(false)]
[Description("True to encode note text")]
public virtual bool NoteEncode
{
get
{
return this.State.Get<bool>("NoteEncode", false);
}
set
{
this.State.Set("NoteEncode", value);
}
}
private JFunction getFieldLabel;
/// <summary>
/// Returns the label for the field. Defaults to simply returning the fieldLabel config. Can be overridden to provide
/// </summary>
[ConfigOption(JsonMode.Raw)]
[Category("5. Field")]
[DefaultValue(null)]
[PersistenceMode(PersistenceMode.InnerProperty)]
[TypeConverter(typeof(ExpandableObjectConverter))]
[Description("Returns the label for the field. Defaults to simply returning the fieldLabel config. Can be overridden to provide")]
public virtual JFunction GetFieldLabel
{
get
{
if (this.getFieldLabel == null)
{
this.getFieldLabel = new JFunction();
}
return this.getFieldLabel;
}
}
/// <summary>
///
/// </summary>
[Description("")]
protected virtual void SetNoteCls(string cls)
{
this.Call("setNoteCls", cls);
}
/// <summary>
///
/// </summary>
[Description("")]
protected virtual void SetNote(string note)
{
this.SetNote(note, this.NoteEncode);
}
/// <summary>
///
/// </summary>
[Meta]
[Description("")]
public virtual void SetNote(string note, bool encode)
{
this.Call("setNote", note, encode);
}
/// <summary>
///
/// </summary>
[Meta]
[Description("")]
public virtual void ShowNote()
{
this.Call("showNote");
}
/// <summary>
///
/// </summary>
[Meta]
[Description("")]
public virtual void HideNote()
{
this.Call("hideNote");
}
/// <summary>
///
/// </summary>
[Description("")]
public virtual List<Icon> Icons
{
get
{
List<Icon> icons = new List<Icon>(1);
icons.Add(this.IndicatorIcon);
return icons;
}
}
/// <summary>
///
/// </summary>
/// <param name="cls"></param>
[Description("")]
protected virtual void SetIndicatorIconCls(string cls)
{
this.Call("setIndicatorIconCls", cls);
}
/// <summary>
///
/// </summary>
/// <param name="icon"></param>
[Description("")]
protected virtual void SetIndicatorIconCls(Icon icon)
{
if (this.IndicatorIcon != Icon.None)
{
this.SetIndicatorIconCls("#" + icon.ToString());
}
else
{
this.SetIndicatorIconCls("");
}
}
/// <summary>
///
/// </summary>
[Description("")]
protected virtual void SetIndicatorCls(string cls)
{
this.Call("setIndicatorCls", cls);
}
/// <summary>
///
/// </summary>
[Description("")]
protected virtual void SetIndicatorText(string text)
{
this.Call("setIndicator", text);
}
/// <summary>
///
/// </summary>
[Description("")]
protected virtual void SetIndicatorTip(string tip)
{
this.Call("setIndicatorTip", tip);
}
/// <summary>
///
/// </summary>
[Meta]
[Description("")]
public virtual void ShowIndicator()
{
this.Call("showIndicator");
}
/// <summary>
///
/// </summary>
[Meta]
[Description("")]
public virtual void HideIndicator()
{
this.Call("hideIndicator");
}
/// <summary>
///
/// </summary>
[Meta]
[Description("")]
public virtual void ClearIndicator()
{
this.Call("clearIndicator");
}
/// <summary>
///
/// </summary>
[Meta]
[Description("")]
public virtual void AlignIndicator()
{
this.Call("alignIndicator");
}
/// <summary>
/// Set the label of this field.
/// </summary>
/// <param name="label">The new label. The label separator will be automatically appended to the label</param>
[Meta]
protected virtual void SetFieldLabel(string label)
{
this.Call("setFieldLabel", label);
}
#endregion
}
}