File tree Expand file tree Collapse file tree 1 file changed +74
-0
lines changed Expand file tree Collapse file tree 1 file changed +74
-0
lines changed Original file line number Diff line number Diff line change 22
33namespace Yajra \DataTables \Html \Editor \Fields ;
44
5+ /**
6+ * @see https://editor.datatables.net/reference/field/select
7+ */
58class Select extends Field
69{
710 protected $ type = 'select ' ;
11+
12+ /**
13+ * Set field multiple value.
14+ *
15+ * @param bool $value
16+ * @return $this
17+ */
18+ public function multiple (bool $ value = true )
19+ {
20+ $ this ->attributes ['multiple ' ] = $ value ;
21+
22+ return $ this ;
23+ }
24+
25+ /**
26+ * Set field optionsPair value.
27+ *
28+ * @param string|array $label
29+ * @param string $value
30+ * @return $this
31+ */
32+ public function optionsPair ($ label = 'label ' , $ value = 'value ' )
33+ {
34+ if (is_array ($ label )) {
35+ $ this ->attributes ['optionsPair ' ] = $ label ;
36+ } else {
37+ $ this ->attributes ['optionsPair ' ]['label ' ] = $ label ;
38+ $ this ->attributes ['optionsPair ' ]['value ' ] = $ value ;
39+ }
40+
41+ return $ this ;
42+ }
43+
44+ /**
45+ * Set field placeholder value.
46+ *
47+ * @param string $value
48+ * @return $this
49+ */
50+ public function placeholder ($ value )
51+ {
52+ $ this ->attributes ['placeholder ' ] = $ value ;
53+
54+ return $ this ;
55+ }
56+
57+ /**
58+ * Set field placeholderDisabled value.
59+ *
60+ * @param bool $value
61+ * @return $this
62+ */
63+ public function placeholderDisabled (bool $ value )
64+ {
65+ $ this ->attributes ['placeholderDisabled ' ] = $ value ;
66+
67+ return $ this ;
68+ }
69+
70+ /**
71+ * Set field placeholderValue value.
72+ *
73+ * @param string $value
74+ * @return $this
75+ */
76+ public function placeholderValue ($ value )
77+ {
78+ $ this ->attributes ['placeholderValue ' ] = $ value ;
79+
80+ return $ this ;
81+ }
882}
You can’t perform that action at this time.
0 commit comments