File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 8
8
use Yajra \DataTables \Html \Options \Plugins \SearchPanes ;
9
9
10
10
/**
11
- * @property string $data
11
+ * @property array| string $data
12
12
* @property string $name
13
13
* @property string $title
14
14
* @property string $titleAttr
@@ -311,11 +311,12 @@ public function width(int|string $value): static
311
311
/**
312
312
* Set column data option value.
313
313
*
314
- * @param string $value
314
+ * @param array| string $value
315
315
* @return $this
316
316
* @see https://datatables.net/reference/option/columns.data
317
+ * @see https://datatables.net/manual/data/orthogonal-data
317
318
*/
318
- public function data (string $ value ): static
319
+ public function data (array | string $ value ): static
319
320
{
320
321
$ this ->attributes ['data ' ] = $ value ;
321
322
Original file line number Diff line number Diff line change @@ -155,4 +155,18 @@ public function it_can_render_scripts()
155
155
$ column ->renderRaw ('test ' );
156
156
$ this ->assertEquals ('test ' , $ column ->render );
157
157
}
158
+
159
+ /** @test */
160
+ public function it_allows_orthogonal_data ()
161
+ {
162
+ $ expected = [
163
+ '_ ' => 'test ' ,
164
+ 'sort ' => 'test ' ,
165
+ 'filter ' => 'test ' ,
166
+ 'type ' => 'test ' ,
167
+ ];
168
+ $ column = Column::make ('name ' )->data ($ expected );
169
+
170
+ $ this ->assertEquals ($ expected , $ column ->data );
171
+ }
158
172
}
You can’t perform that action at this time.
0 commit comments