• Resolved richardmillette

    (@richardmillette)


    Hi! I’ve been trying in vain to find solutions for these 4 questions.
    Situation: we are going to have a TablePress table displaying statc data imported from (a very old version of) Filemaker Pro. That works perfectly. The test page link give an idea of the type of info that will be displayed. I want users to be able to request more information about various table rows.
    The table displays perfectly, it’s responsive like we want it to be. Now my questions:
    1: How can a selected row be highlighted? Clicking the “+” button shows additional info, but I would like it to be highlighted and to stay that way.
    2: Can the Datatables “Copy” button copy ONLY the selected rows’ data – not the whole table? It works if I search manually for a row id, for instance.
    3: How can I change the Copy button Success message to French. I’m using this custom command
    “dom”:”lfrtBip”, “buttons”:[{extend:”copy”,text:”Copier la ligne”, copyTitle: ‘Copié avec succès’, copySuccess:””,header: false } ].
    This changes the copy button text OK, but the success message remains in English.
    4: Is is possible to automatically paste the copied content into a field in the contact form? (It works if done manually)
    Thank you for your help.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    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

    Thread Starter richardmillette

    (@richardmillette)

    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.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    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

    Thread Starter richardmillette

    (@richardmillette)

    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.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    hhm 🙁 I had found this in the DataTables documentation. I have no idea why it’s not working here, sorrry.

    Best wishes,
    Tobias

    Thread Starter richardmillette

    (@richardmillette)

    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.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    ah, great! Good to hear that it works now! 🙂
    And thanks for wanting to donate, I really appreciate it!

    Best wishes,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘4 questions’ is closed to new replies.