Skip to content

Dropdown for selecting value in column#4

Open
07lodgeT wants to merge 3 commits intomaxupp:masterfrom
07lodgeT:patch-1
Open

Dropdown for selecting value in column#4
07lodgeT wants to merge 3 commits intomaxupp:masterfrom
07lodgeT:patch-1

Conversation

@07lodgeT
Copy link

Using the datatables API, added a dropdown to be able to select a specific value in each column.
Useful for getting data for a certain car or track without having to flick through table
https://www.datatables.net/examples/api/multi_filter_select.html

Using the datatables API, added a dropdown to be able to select a specific value in each column.
Useful for getting data for a certain car or track without having to flick through table
https://www.datatables.net/examples/api/multi_filter_select.html
Copy link
Author

@07lodgeT 07lodgeT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On line 120, will change to: this.api().columns([0, 1, ]).every( function () {
This would only show dropdown on track and cars columns

@maxupp
Copy link
Owner

maxupp commented Apr 2, 2021

Hey!
I'm sorry it's taken me this long, but I've had a chance to look at this just now. Love the idea, and I'd like to have that funtionality. However we have reworked a lot of the project in the meantim, and I'm experiencing an issue where after selecting one of the values none of the entries are left after filtering. I'm not sure what exactly is happening. Could you have a look at the current master?

Can change line 97 to column.footer if wanted filter at the bottom
@07lodgeT
Copy link
Author

07lodgeT commented Apr 8, 2021

Hey,
I've updated the index.php with the lastest code from the master now.
It seems to be working for me.

Only issue would be if someone selects a track, then a car that doesn't have any times for that track. The table would be empty.
There may be a way round it with js but i'm not that proficient with it yet...

On line 97 you can change .appendTo( $(column.header())) to .appendTo( $(column.footer())) to move the dropdown to the bottom if you'd prefer it. Or change it to .appendTo( '#divid' ) to move it to a different place altogether.
Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants