Okay
  Public Ticket #1526584
Filtering Table Output
Closed

Comments

  •  1
    Aaron started the conversation

    Sorry if I missed this in the documentation.  Are you able to automatically filter data on the front-end without requiring the user do so?  For example, on my website the user will be able to create several courses.  In each course, I'd like them to enter data into a wpDataTable.  However, I only want the data shown for the specific course their viewing (none others).  Is there a way to do this such as passing a filter value through the shortcode?  I can't do it based on author because the author may have more than one course created.  Also, I don't want them to be able to change the filter themselves.  Thanks for any tips.

  •  471
    Isidora replied

    HI Aaron,
    Thank you for your purchase.

    You can take a look in our documentation about Placeholders.

    Best regards.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  •  1
    Aaron replied

    Hi Milan,

    I did look at that documentation, but was feeling a little confused on one piece.  I created a manual table, and I don't see the placeholders option appear in the table configuration.  Do I need to create a second table using a MySQL Query instead?  If so, do you need to create a column in the manual table that stores the post ID and then query off it using the MySQL table?  Ideally, I'd have a table that had three columns: AssignmentType, AssignmentWeight, and PostID.  Then I would have the table only display rows where the PostID was equal to the current WordPress post being displayed.  Can you just clarify how I do this with placeholders?  Thanks.


    - Aaron

  •  1
    Aaron replied

    PS - I played around with it a bit more and can add an additional column to my manual table called PostID and have it default to the Post ID Placeholder, but when I try to hide the field so the user can't edit it or doesn't see it when adding a new row, it doesn't store the Post ID.

  •  471
    Isidora replied

    HI Aaron,

    With Mysql based table you can use placeholder. If you made manual table you can use table that is made in database when you create manual table which you can find in option Mysql table name for editing on EDITING tab in table settings. Then make new table from query

    SELECT * FROM table_name WHERE postid = "%VAR1%" 

    And set default value in %VAR1% on PLACEHOLDER tab to make a table.

    With different values pass in var1 in shortcode of that table you can show different table result on every page.

    For example on fist page you can insert [wpdatatable id=1 var1=20]  on second page you can insert [wpdatatable id=1 var1=40] ... so you are using one table with different data in table depends of the value of placeholder that you pass.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  •  1
    Aaron replied

    Hi Milan,

    Thanks for this explanation.  The only thing I'm not sure how to do is to get new entries to have the PostID without the user needing to enter it.  If I setup a MySQL table and have PostID='%VAR1%' will the user be able to add new rows without typing the PostID, and without being able to see it?  I do not want this field to be visible to the user.  Thanks.

    - Aaron

  •  1
    Aaron replied

    Even if the PostID field is hidden in the table, it still shows up in the "Add New Entry" pop-up window.  I'm nervous that users will accidentally (or purposefully) change the value of the PostID field, which could cause problems.  The only way I can figure to hide the field from the "Add New Entry" screen is to change Editor Input Type to "None" but when I do that it no longer sets the default value to %CURRENT_POST_ID% OR %VAR1%.  Instead, you get an error message saying that the PostID field cannot be blank.

  •  471
    Isidora replied

    Hi Aaron,
    Sorry for late response,

    Please note that we have a National holiday in our country from Friday 6th to Monday 9th.

    You can hide that input field from edit modal by css. You have to find specific class for that input field  with Inspect element of the browser and hide it with css.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  •  1
    Aaron replied

    Thanks, Milan.  I was able to find the element and add some CSS that successfully hid the input field.  However, I'm having some trouble hiding the label.  Here is the code.  Can you spot what I'm doing wrong?  First line works, second doesn't.

    #table_1_courseid { display: none;}  <-- this successfully hides the input

    #table_1_courseid_label { display: none;}   <-- this one isn't working


  •  471
    Isidora replied

    HI Aaron,

    Yes your second css rule is not working because you set id that is not exist in wpdatatables. If you check in Inspect element of the browser you can see that label for each input don't have specific id that you can use it ,but they have attribute for that you can use it in that purpose like this: 

    label[for=table_1_courseid]{ display: none;}


    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  •  1
    Aaron replied

    Hi Milan,

    I tried inserting the following code but the label is still appearing.  Below is the code and attached is a screen shot of the label still appearing along with the ID.  Am I still doing something wrong in the code?  Thanks.

    /*HOUSEHOLD-COURSE - HIDE THE POST ID IN THE WEIGHTING TABLE */

    #table_1_courseid { display: none;}
    label[for=table_1_courseid] { display: none;}

    /*HOUSEHOLD-COURSE - HIDE THE POST ID IN THE ASSIGNMENTS TABLE */

    #table_3_courseid { display: none;}
    label[for=table_3_courseid] { display: none;}


  •  471
    Isidora replied

    Hi Aaron,

    Sorry for late response. 

    We are located in Serbia and our working time is from 10:00 to 17:00 CET. business days.

    Probably there is a css rule with more priority, so please add !important in your css rule like this.

    #table_1_courseid { display: none !important;}
    label[for=table_1_courseid] { display: none !important;}


    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  •  1
    Aaron replied

    No worries on the timing.  Adding !important had no effect on the form.  Also, the whole entry form now looks all messed up, even with all the special CSS removed.  I have no idea what would have triggered this to stop working.  See attached image.  The lines don't seem to match up with the field names any more.  Is it possible there is a plugin conflict?  I recently installed some plugins such as Autoptimize, WP Hide & Security, and WP-Optimize.  Maybe I will try deactivating them one at a time.  Do you have any other ideas?  Thanks again for the help.  Hopefully we can figure it out soon.


    - Aaron

  •  1
    Aaron replied

    Okay - when I deactivated Autoptimize the styling went back to normal.  Then I reactivated it and went through each setting to see what triggers the problem.  Optimizing HTML causes the styling to get messed up, so I have disabled this feature in Autoptimize.

    Adding !important still has no effect and I cannot seem to get the course ID label to hide:

    <code>

    /*HOUSEHOLD-COURSE - HIDE THE POST ID IN THE WEIGHTING TABLE */

    #table_1_courseid { display: none;}
    label[for=table_1_courseid] { display: none;}

    /*HOUSEHOLD-COURSE - HIDE THE POST ID IN THE ASSIGNMENTS TABLE */

    #table_3_courseid { display: none !important;}
    label[for=table_3_courseid] { display: none !important;}

    </code>

  •  471
    Isidora replied

    HI Aaron,

    Please provide me a temporary WP-admin login for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course we do not provide login data to third party. You can write credentials here just check Private Reply so nobody can see them except us.

    Also point me on table id for which you are settings this css and also a page where you insert shortcode of this table so I can take a look.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  •  1
    Aaron replied

    Hi Milan,

    It seems like I've managed to get it to work.  I think some recent plugins I was installing (like Autoptimize) were wreaking havoc on some of the CSS.  I've cleaned up all the plugins and the Course ID label has now gone away.  Thanks for all your help.  I very much appreciate it.

    - Aaron

  •  471
    Isidora replied

    HI Aaron,

    You are welcome.  I am glad that now everything is working fine.

    If you have any more issues or questions feel free to open a new ticket, we will gladly help.

    We'd greatly appreciate it if you could take a minute and leave a review on CodeCanyon on this link. Thanks! 

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables