Hi,
thanks for your post, and sorry for the trouble.
1) What do you mean with “stay that way”? For how long? You could simply adjust the styling of the expanded rows, but adding this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:
.tablepress .parent td,
.tablepress .child td {
background-color: #0000ff;
color: #ff0000;
}
2) No, sorry, there’s no direct possibility for that, as the rows are not actually “selected”, they are just “expanded”. You might however want to try a “Custom Commands” approach, based on the CSS classes:
"dom": "lfrtBip",
"buttons": [
{
"extend": "copy",
"text": "Copier la ligne",
"copyTitle": "Copié avec succès",
"copySuccess":"Copié avec succès",
"header": false,
"exportOptions": { "rows": ".parent,.child" }
}
]
This should also fix 3), because copySuccess is empty in your current version.
4) Unfortunately, I don’t know a way for that, sorry.
Regards,
Tobias
Thanks a million for your incredibly quick response! The styling function works like a charm – and is exactly what I wanted to achieve!
Unfortunately, the message returned to the user after clicking the “Copier la ligne” button remains in English. Also, after adding the “exportOptions” to the command, if the user does not expand the line (Don’t laugh, it could happen…), the success message returns “O lines copied” and, accordingly, the line is not copied. If that is not present however, the line is copied correctly in all cases – so I’ll do without.
As for the success confirmation, I know Mr Jardine suggests a way to translate it, but I can’t make his method work (Sheer ignorance, I guess).
So, for the moment, users will have to live with an English message… Thanks again.
Hi,
one more suggestion for the translation: Please try
"dom": "lfrtBip",
"buttons": [
{
"extend": "copy",
"text": "Copier la ligne",
"copyTitle": "Copié avec succès",
"copySuccess": {
"1": "Copié avec succès (one row)",
"_": "Copié avec succès (%d rows)"
},
"header": false,
"exportOptions": { "rows": ".parent,.child" }
}
]
Unfortunately, I don’t have a solution for that row selection problem, sorry.
Regards,
Tobias
Nope… same result: I still get the English message (which is correct, though).
There must be something missing: it’s like the “copyTitle” and “copySuccess” part of the command was being ignored.
The rest works perfectly though, thanks.
Hi,
hhm 🙁 I had found this in the DataTables documentation. I have no idea why it’s not working here, sorrry.
Best wishes,
Tobias
Success!
I copied the example from the DataTables documentation, that I was also inspired by, and pasted it directly in the custom command field. It works perfectly. I capitalized the “l” in “lfrtBip” to match ‘Brftip” and it started to work. This is the code I have :
"dom": 'LfrtBip',
language: {
buttons: {
copyTitle: 'Ajouté au presse-papiers',
copySuccess: {
_: '%d lignes copiées',
1: '1 ligne copiée'
}
}
}
Thanks again for your help – You’re the Best!!!!!
Donation on the way.
Hi,
ah, great! Good to hear that it works now! 🙂
And thanks for wanting to donate, I really appreciate it!
Best wishes,
Tobias