Display a column instead of a row
Display a column instead of a row

Hi,
I am searching this for a long time and I found nothing.
I would like to display a column instead of a row after searching for something.
For example, when i search 'Satou' here , i would like to see all the column Name because Airi Satou belong to the column Name ( instead of seeing the row for the Name/ Position/Office/etc. )
I'm really stuck, i really appreciate some helps, thank you
This question has accepted answers - jump to:
This discussion has been closed.
Answers
when i search a website then that site is unable to lack of datatable please help me please
Maybe it is better if you post your question in a post of its own, with more details of your problem, just the button "ask a question" for a new topic
@you2525 That's not possible by default, I'm afraid, but you could create your own filter to do that.
You would get the column data for each column with
column().data()
, filter it withfilter()
(there's an example on that page doing just this), then hide columns that don't match withcolumn().visible()
. It shouldn't be too trickyColin
Ok, i think i understand what you mean theoretically, but, i'm a newbie... specially in js.
Can you show me more in details how can i do it ? or a example somewhere else... ?
someting more pratical to combine all of these functions ?
I'm thinking maybe there is another way to do it (because maybe this is too difficult for me), i have the same table but the rows=columns, so the result of the search by row is fine here. Do you think i can use this table to search and then display the result (originally in rows) by column ? ( so only play on the display and not with the search method) if yes, i don't know how to play on the display iike this, if you have a idea, i'm interested too
Thank you
(my proposition seems to be not possible)
Colin's response is the way to do this. Sounds like an interesting idea so put together a simple example for you.
http://live.datatables.net/lakomafi/1/edit
In addition to the API's Colin mentioned you will want to look at
columns().every()
andcount()
. I used thedom
option to show just the Datable search input and table. I removed the Datatables event listeners from the search input and create my own.The search behaves close to the Smart search capabilities documented in the
search()
API docs.HTH,
Kevin
Thank you so much for your help, i adapted your example to my code and it works great !

(and i understand what i do aha, perfect)
Great, glad it was useful for you!
Kevin