Okay
  Public Ticket #1139065
wpDataTable pre-filtering using shortcode
Closed

Comments

  •  4
    John started the conversation

    I used wpDataTables to manually create a table and I added seven (7) records.

    The table has a field, T1PartyManager, that I want to use to pre-filter the records before the table is displayed. This is necessary because different users (i.e. Party Managers) should only see the records assigned to them (using the T1PartyManager field), so I don't want the users to be able to set or change the filter value.

    Each user will have his own page, therefore I want to use the shortcode to set the T1PartyManager field filter value and then display the table. However, because this table was created manually, there is nowhere to link the shortcode  '%var1' field to the T1PartyManager field.

    Thoughts?


  • [deleted] replied

    Hi John Johansen,
    Thank you for the purchase.

    You can always create MySQL based table on manual table. Manual wpDataTables has own table in the database called wp_wpdatatable_{some_id}. You can see what table from database wpDataTable is using directly in the database. Then you will be able to use placeholders (variables) in newly created wpDataTable based on MySQL query. If you pre-filter the table, it will just add that value in filter and everybody will be able to remove it from that input and see all data. Maybe you can deny users to change that input field by making that column T1PartyManager invisible.

    Also maybe you can use User can see and edit only own data but then T1PartyManager field should be that user ID. You can take a look at this feature at this link.

  •  4
    John replied

    Understood.

    I created my own MySQL tables using PHPMyAdmin, and I was able to use the Table Constructor to join them.

    That said, I will review the link contents and see if I can use that technique in the future.

    Please close this ticket.