• Resolved mrheffner

    (@mrheffner)


    Hello,

    Is there a way to associate an HTML ID attribute to the resulting table? I would like to create a button to enable the user to export the content of the table and need a way to refer to the specific table.

    My code would look something like the following. However, I can’t seem to find a way to assign “gtable” as the ID. I have seen some plugins that allow the ID to be specified in the shortcode, but with this plugin the ID in the shortcode has a different purpose.

    <a href="#" onClick ="jQuery('#gtable').tableExport({type:'excel',escape:'false'});">XLS</a>

    Thanks!

    • This topic was modified 7 years, 1 month ago by mrheffner.
    • This topic was modified 7 years, 1 month ago by mrheffner.
    • This topic was modified 7 years, 1 month ago by mrheffner.
    • This topic was modified 7 years, 1 month ago by mrheffner.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Ian Sadovy

    (@iansadovy)

    Hello @mrheffner,

    Thank you for the question.
    I’ve got it, and your suggestion about setting ID in the shortcode sounds reasonable.
    I will definitely do this in the next update. For now, as a workaround, you can use .jsgrid-table selector to access the table via jQuery. If you have more than 1 table on the page, you may also specify the index of the table, i.e. jQuery('.jsgrid-table').eg(1).

    Please let me know if it helps.

    Regards,
    Ian

    Thread Starter mrheffner

    (@mrheffner)

    Hello Ian,

    This looks like it should address my concern. I was not aware of the “eg” option. Thanks.

    I am looking forward to your future updates.

    Nice plugin.

    Thanks,
    Mike

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘ADD html ID attribute to Table’ is closed to new replies.