File tree 1 file changed +36
-0
lines changed
1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ Documentation
25
25
1 . [ array] ( #array )
26
26
1 . [ tabarray] ( #tabarray )
27
27
1 . [ Post process function] ( #post-process-function )
28
+ 1 . [ Manual field insertion] ( #manual-field-insertion )
28
29
1 . [ Extending Schema Form] ( extending.md )
29
30
30
31
Basic Usage
@@ -1010,3 +1011,38 @@ angular.module('myModule', ['schemaForm']).config(function(schemaFormProvider){
1010
1011
1011
1012
});
1012
1013
` ` `
1014
+
1015
+
1016
+
1017
+ ### Manual field insertion
1018
+ There is a limited feature for controlling manually where a generated field should go so you can
1019
+ ,as an example, wrap it in custom html. Consider the feature experimental.
1020
+
1021
+ It has a number of drawbacks though.
1022
+
1023
+ 1. You can only insert fields that are in the root level of your form definition, i.e. not inside fieldset, arrays etc.
1024
+ 1. Generated fields are always last in the form so if you don't supply slots for all of your top level fields the rest goes below.
1025
+ 1. To match "keys" of forms we match against the internal array format, hence the key "name" becomes "['name']" and "foo.bar" becomes "['foo']['bar']"
1026
+
1027
+ Define "slots" for the generated field by adding an element with the attribute ` sf- insert- field`
1028
+
1029
+ ex.
1030
+ ` ` ` js
1031
+ $scope .form = [
1032
+ " name" ,
1033
+ " email" ,
1034
+ " comment"
1035
+ ]
1036
+ ` ` `
1037
+
1038
+ ` ` ` html
1039
+ < form sf- model= " model"
1040
+ sf- form= " form"
1041
+ sf- schema= " schema" >
1042
+ < em> before< / em>
1043
+ < div sf- insert- field= " ['email']" >< / div>
1044
+ < em> after< / em>
1045
+
1046
+ <!-- the rest of the form, i .e . name and comment will be generated here -->
1047
+ < / form>
1048
+ ` ` `
You can’t perform that action at this time.
0 commit comments