Skip to content

Commit 4d6d132

Browse files
authored
Merge pull request #261 from yajra/fix3256
fix: cc footer search
2 parents 0aa9646 + ad6f7a0 commit 4d6d132

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

β€Žsrc/Html/Options/Plugins/ColumnControl.phpβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function columnControlFooter(array $content, int $target = 0): static
7070

7171
public function columnControlFooterSearch(array $content = []): static
7272
{
73-
$this->addColumnControl('tfoot', [empty($content) ? ['search'] : $content]);
73+
$this->columnControlFooter(empty($content) ? ['search'] : $content);
7474

7575
return $this;
7676
}

β€Žtests/Html/Builder/BuilderTest.phpβ€Ž

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,10 @@ public function it_can_set_template_data(): void
318318

319319
$builder
320320
->setTableId('my-table')
321-
->setTemplateData(function (Builder $builder): array {
322-
return [
323-
'tableId' => $builder->getTableId(),
324-
'message' => 'Set Template Data Using Callback',
325-
];
326-
});
321+
->setTemplateData(fn (Builder $builder): array => [
322+
'tableId' => $builder->getTableId(),
323+
'message' => 'Set Template Data Using Callback',
324+
]);
327325

328326
$this->assertStringContainsString(
329327
"console.log({ tableId: 'my-table', message: 'Set Template Data Using Callback' });",

β€Žtests/Html/Extensions/ColumnControlTest.phpβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function it_can_add_column_control_footer_search()
110110

111111
$this->assertInstanceOf(Builder::class, $result);
112112
$expected = [
113-
['target' => 'tfoot', 'content' => [['search']]],
113+
['target' => 'tfoot:0', 'content' => ['search']],
114114
];
115115
$this->assertEquals($expected, $builder->getAttributes()['columnControl']);
116116
}
@@ -125,7 +125,7 @@ public function it_can_add_column_control_footer_search_with_custom_content()
125125

126126
$this->assertInstanceOf(Builder::class, $result);
127127
$expected = [
128-
['target' => 'tfoot', 'content' => [['customSearch']]],
128+
['target' => 'tfoot:0', 'content' => ['customSearch']],
129129
];
130130
$this->assertEquals($expected, $builder->getAttributes()['columnControl']);
131131
}

0 commit comments

Comments
 (0)