titre du regroupement qui disparaît quand on clic dessus
titre du regroupement qui disparaît quand on clic dessus

Bonjour,
J'ai utilisé dataTable pour y intégrer mon tableau dedans.
J'ai utilisé les rowGrouping pour regrouper sur les valeurs d'une colonne.
Sauf que comme dans l'exemple : https://datatables.net/examples/advanced_init/row_grouping.html , quand je clique part exemple sur Edinburgh, le titre Edinburgh disparaît.
J'aimerais que les titres restent.
Comment faire?
Merci,
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
In that example, the
click
just changes the ordering, you can remove the code at the bottom of the page if you don't want that behaviour - it's just there as an example.Colin
Thank you,
What I want is that when we click on Edinburgh for example. The Edinburgh news disappears, but the Edinburgh name remains visible.
I'm sorry, I'm not following. Could you give step-by-step instructions on what you would like to happen, please?
take the example of the link above, I understand that it just changes the order. Ok. But is it possible that when we click on the grouping like Edinburgh (I do not change the order, so I remove the code of inversement;)) But that the information of the grouping is hide ( as a drop-down menu).
@Colin - I think the op wants an accordion effect.
Ah, thanks, do you mean something like example this from this thread?
Yes that's exactly right, thanks to you
Do you have to put data-search and data-order in the html to do something?
Because I do not see how I can put them in my html.
No, it works without it too.
Great, the grouping works.
Can I still again ask you a question?
Can I now group in my first group on another column of the table?
Thank you very much.
You can group on two columns, if that's what you mean - see here.
Colin
Yes that's exactly it.
It works well when the value is an integer.
But, my value is for example : "503 xxx" where xxx is a alphabetic character.
And here, he can not sort with 503.
is there a solution.
Thank you.
rowGroup.dataSrc
can be a function, as in this example here. You could use that to strip out your "xxx" after the error code.Colin
For that to be more easier, I have add one column with the integer value.
Therefore in my values I have for example 503.
If I do dataSrc: [ 2, 1 ] , group equals Undefined .
I want 2 accordion effect.
Could you create a test case for this, please, it'll help understand what you're after. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Ok,
Here is what I currently have :
http://live.datatables.net/pojewila/4
http://live.datatables.net/pojewila/4/edit
There I am grouping for example by City.
Now in a city, for example, I want to group by the ages.
For example in Edinburgh, the 2 "22 years" will be grouped together ... with an accordion effect.
The problems were
1. you were using an old version of RowGroup before multi-level grouping was adding
2. you weren't also sorting on the second grouping column.
See updated test case here: http://live.datatables.net/pojewila/5/edit
Colin
It's good,
But I can not click on the groups.
And my groups is no longer folded.
It is possible ?