• Resolved pladekusken

    (@pladekusken)


    Is it possible to make the grid (publication of mySQL table from db:view) be responsive of more column other than only the first one as it works today?
    I would like that the row details shows when I click any place on the row or more fields on same row… I hope this can be done some how?
    I have tried some different response setup in the plugin under Publications/”myPublication”, area; Advanced settings; Table options (advanced).

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi @pladekusken,

    You can use the following JSON in your advanced settings:
    { "responsive": { "details": { "type": "column", "target": "tr" } } }
    But this will only work for expanded publications. Not for modal popups.

    For modal popups you might be able to do this with the initComplete event. It works similar to the fnRowCallback event which is explained here:
    https://wpdataaccess.com/docs/documentation/data-publisher/advanced-settings/

    I haven’t tried this myself. If you have a working solution I would greatful if you can post it here.

    Thanks,
    Peter

    Thread Starter pladekusken

    (@pladekusken)

    Hi again
    Your suggestion do not work for the modal popups – as you said.
    I have tried to look into this but with no luck.
    Could you try to do some magic – to make it work on the modal ??
    Best regards,
    René

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Okay @pladekusken,

    You asked for it! ??

    First you need to add this code to the advanced settings of your publication:
    { "initComplete": "function(settings, json) { myInitComplete() }" }

    Then you need to make this javascript function available on your publication page:

    function myInitComplete() {
    	jQuery("#<put-your-table-id-here> tbody").on("click", "td", function(e) {
    		if (!jQuery(this).hasClass("dtr-control")) {
    			jQuery(this).closest("tr").find("td.dtr-control").click();
    		}
    	});
    }

    Make sure to replace “put-your-table-id-here” with the table id of your publication table. Just open the inspector to find it. Don’t worry, it does not change!

    Advanced settings are explained here:
    https://wpdataaccess.com/docs/documentation/data-publisher/advanced-settings/

    You can use the Code Manager to add the javascript function. You can download it from here:
    https://www.ads-software.com/plugins/code-manager/

    Like it? ??
    Peter

    Thread Starter pladekusken

    (@pladekusken)

    Hi again – I could not make it work with cm?
    I have tried different combo for the table id – maybe that is the issue (also tried with and without #<> in diff combos) – i am also not sure if wpTicker3 is the right id (have tried 3 and other combo as well)
    Added javascript to cm (id=2):

    function myInitComplete() {
    	jQuery("#<wpTicker3> tbody").on("click", "td", function(e) {
    		if (!jQuery(this).hasClass("dtr-control")) {
    			jQuery(this).closest("tr").find("td.dtr-control").click();
    		}
    	});
    }

    Added shortcodes to page:
    [cmruncode id=”2″][wpdataaccess pub_id=”3″]

    And added: Table options (advanced)
    { "initComplete": "function(settings, json) { myInitComplete() }" }

    The table works but the details are only shown when clicking the first column…
    Am I missing something?

    • This reply was modified 3 years, 2 months ago by pladekusken.
    • This reply was modified 3 years, 2 months ago by pladekusken.
    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi @pladekusken,

    Can you share a public URL to view the publication? Please use the contact form on the plugin website if you prefer to share this information in private.

    Thanks,
    Peter

    Thread Starter pladekusken

    (@pladekusken)

    Hi again – Thx for helping – This topic can be closed now ??
    The issue was:
    “show Icon” = Yes (it was set to No earlier)
    jQuery(“#<wpTicker3> tbody”)… changed to: jQuery(“#wpTicker3 tbody”)…
    Thx,
    René

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WP Data Access, Row details triggered from all columns?’ is closed to new replies.