|
| 1 | +<div style="width: 300px;"> |
| 2 | + <JqxForm value=value template=template></JqxForm> |
| 3 | +</div> |
| 4 | + |
| 5 | +@code { |
| 6 | + static IDictionary<string, string>[] columns = new Dictionary<string, string>[] |
| 7 | + { |
| 8 | + new Dictionary<string, string> |
| 9 | + { |
| 10 | + { "type", "button" }, |
| 11 | + { "text", "Sign Up" }, |
| 12 | + { "width", "90px" }, |
| 13 | + { "columnWidth", "50%" }, |
| 14 | + { "align", "right" } |
| 15 | + }, |
| 16 | + new Dictionary<string, string> |
| 17 | + { |
| 18 | + { "type", "button" }, |
| 19 | + { "text", "Cancel" }, |
| 20 | + { "width", "90px" }, |
| 21 | + { "columnWidth", "50%" } |
| 22 | + } |
| 23 | + }; |
| 24 | + |
| 25 | + IDictionary<string, string> value = new Dictionary<string, string> |
| 26 | + { |
| 27 | + { "firstName", "John" }, |
| 28 | + { "lastName", "Scott" }, |
| 29 | + { "address", "1st Ave SW" }, |
| 30 | + { "city", "San Antonio" }, |
| 31 | + { "state", "Texas" }, |
| 32 | + { "zip", "78209" } |
| 33 | + }; |
| 34 | + |
| 35 | + IDictionary<string, object>[] template = new Dictionary<string, object>[] |
| 36 | + { |
| 37 | + new Dictionary<string, object> |
| 38 | + { |
| 39 | + { "bind", "firstName" }, |
| 40 | + { "type", "text" }, |
| 41 | + { "label", "First name" }, |
| 42 | + { "required", true }, |
| 43 | + { "labelWidth", "85px" }, |
| 44 | + { "width", "250px" }, |
| 45 | + { "info", "Enter first name" }, |
| 46 | + { "infoPosition", "right" } |
| 47 | + }, |
| 48 | + new Dictionary<string, object> |
| 49 | + { |
| 50 | + { "bind", "lastName" }, |
| 51 | + { "type", "text" }, |
| 52 | + { "label", "Last name" }, |
| 53 | + { "required", true }, |
| 54 | + { "labelWidth", "85px" }, |
| 55 | + { "width", "250px" }, |
| 56 | + { "info", "Enter last name" }, |
| 57 | + { "infoPosition", "right" } |
| 58 | + }, |
| 59 | + new Dictionary<string, object> |
| 60 | + { |
| 61 | + { "bind", "company" }, |
| 62 | + { "type", "text" }, |
| 63 | + { "label", "Company" }, |
| 64 | + { "required", false }, |
| 65 | + { "labelWidth", "85px" }, |
| 66 | + { "width", "250px" } |
| 67 | + }, |
| 68 | + new Dictionary<string, object> |
| 69 | + { |
| 70 | + { "bind", "address" }, |
| 71 | + { "type", "text" }, |
| 72 | + { "label", "Address" }, |
| 73 | + { "required", true }, |
| 74 | + { "labelWidth", "85px" }, |
| 75 | + { "width", "250px" } |
| 76 | + }, |
| 77 | + new Dictionary<string, object> |
| 78 | + { |
| 79 | + { "bind", "city" }, |
| 80 | + { "type", "text" }, |
| 81 | + { "label", "City" }, |
| 82 | + { "required", true }, |
| 83 | + { "labelWidth", "85px" }, |
| 84 | + { "width", "250px" } |
| 85 | + }, |
| 86 | + new Dictionary<string, object> |
| 87 | + { |
| 88 | + { "bind", "state" }, |
| 89 | + { "type", "option" }, |
| 90 | + { "label", "State" }, |
| 91 | + { "required", true }, |
| 92 | + { "labelWidth", "85px" }, |
| 93 | + { "width", "250px" }, |
| 94 | + { "component", "jqxDropDownList" }, |
| 95 | + { |
| 96 | + "options", |
| 97 | + new Dictionary<string, object>[] |
| 98 | + { |
| 99 | + new Dictionary<string, object> |
| 100 | + { |
| 101 | + { "value", "California" } |
| 102 | + }, |
| 103 | + new Dictionary<string, object> |
| 104 | + { |
| 105 | + { "value", "New York" } |
| 106 | + }, |
| 107 | + new Dictionary<string, object> |
| 108 | + { |
| 109 | + { "value", "Oregon" } |
| 110 | + }, |
| 111 | + new Dictionary<string, object> |
| 112 | + { |
| 113 | + { "value", "Illinois" } |
| 114 | + }, |
| 115 | + new Dictionary<string, object> |
| 116 | + { |
| 117 | + { "value", "Texas" } |
| 118 | + } |
| 119 | + } |
| 120 | + } |
| 121 | + }, |
| 122 | + new Dictionary<string, object> |
| 123 | + { |
| 124 | + { "bind", "zip" }, |
| 125 | + { "type", "text" }, |
| 126 | + { "label", "Zip code" }, |
| 127 | + { "required", true }, |
| 128 | + { "labelWidth", "85px" }, |
| 129 | + { "width", "250px" } |
| 130 | + }, |
| 131 | + new Dictionary<string, object> |
| 132 | + { |
| 133 | + { "rowHeight", "10px" }, |
| 134 | + { "type", "blank" } |
| 135 | + }, |
| 136 | + new Dictionary<string, object> |
| 137 | + { |
| 138 | + { "columns", columns } |
| 139 | + } |
| 140 | + }; |
| 141 | +} |
0 commit comments