Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Search Column with Conditional Logic in Hermawan DataTables #49

Open
nurissetiabudi opened this issue Jul 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@nurissetiabudi
Copy link

Description:
I encountered an issue where I cannot search a column that uses conditional logic (if) in Hermawan DataTables. Specifically, when defining a custom column using add(), if the logic involves an if statement, the column becomes unsearchable in the DataTables interface.

Steps to Reproduce:

Define a DataTable using Hermawan DataTables.
Use the add() method to define a custom column with conditional logic (if statement).
Attempt to search within this custom column in the DataTables interface.
Expected Behavior:
The column defined with conditional logic (if statement) should be searchable in the DataTables interface. Users should be able to filter and search based on the values derived from the conditional logic.

Actual Behavior:
The column is not searchable. Attempts to search within the column in the DataTables interface yield no results or do not function as expected.

Code Example:

->add('status_dihubungi', function($row){
if ($row->periksa_status_dihubungi == 1) {
return "Sudah Dihubungi";
} else {
return "Belum Dihubungi";
}
})

Additional Information:
This issue seems to be related to how Hermawan DataTables handles columns defined with conditional logic during server-side processing. It affects the usability of DataTables in scenarios where dynamic content based on conditional statements needs to be searchable.

@nurissetiabudi nurissetiabudi added the bug Something isn't working label Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant