Okay
  Public Ticket #2306685
Data Filter
Closed

Comments

  • Cedric started the conversation

    Hi Guys,

    I would like users able to search data or date range like feb 12 to mar 15.

    When I tried to do the date range logic. It gives me an error like


    Uncaught Error: Call to a member function format() on boolean in /mnt/c/Projects/alex/wp-content/plugins/wdt-gravity-integration/wdt-gravity-integration.php:849 Stack trace: #0 /mnt/c/Projects/alex/wp-content/plugins/wdt-gravity-integration/wdt-gravity-integration.php(534): WDTGravityIntegrationPlugin::prepareSearchCriteria(Array, Array) #1 /mnt/c/Projects/alex/wp-content/plugins/wdt-gravity-integration/wdt-gravity-integration.php(463): WDTGravityIntegrationPlugin::generateFormArray(1, Array, NULL) #2 /mnt/c/Projects/alex/wp-includes/class-wp-hook.php(288): WDTGravityIntegrationPlugin::gravityBasedConstruct(Object(WPDataTable), Object(stdClass), Array) #3 /mnt/c/Projects/alex/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters('', Array) #4 /mnt/c/Projects/alex/wp-includes/plugin.php(478): WP_Hook->do_action(Array) #5 /mnt/c/Projects/alex/wp-content/plugins/wpdatatables/source/class.wpdatatable.php(2907): do_action('wpdatatables_ge...', Object(WPDataTable), '{"formId":1,"fi...', Array) #6 /mnt/c/Pro in /mnt/c/Projects/alex/wp-content/plugins/wdt-gravity-integration/wdt-gravity-integration.php on line 849

  •  2,572
    Aleksandar replied

    Hello Cedric

    Than you for your purchase.

    Please be aware that filtering, sorting and searching may not work as expected for complex entries when server side is turned on. This problem is on Gravity side, and we are working on providing a solution.

    If you don't need this table to be editable, and if it doesn't have over 2.000 rows, you can disable Server-Side processing, and filters should work normally.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

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

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Cedric replied

    Hi Aleksandar,

    Users need to edit the entry. 

    Also, they want to export files base on dated like month of Feb, March etc..

    So there's now way for me to do search date by month?

    Kind regards,
    Cedric

  • Cedric replied

    I have table with three columns:

    (columns) User_ID   Name     Age    Color  
    (values)  2020012    Cedric    21       Brown

    Is it possible to modify the output of the table tr?

    Like:

    <tr data-user-id='2020012' data-name='name' data-age='21' data-color='brown' >
    <td>2020012</td>
    <td>Cedric</td>
    <td>21</td>
    <td>Brown</td>
    </tr>

    So that I can the data via javascript too.

    I used this filter but it gives me an error:

    add_filter( 'wpdatatables_filter_server_side_data', function( $json, $tableId, $_GET ){

        return $json;
      
    });

    ERROR: DataTables warning: table id=table_1 - Ajax error. For more information about this error, please see http://datatables.net/tn/7


  •  2,572
    Aleksandar replied

    Hi Cedric

    The tr is being created in this file, and you can include whatever you need in it:

    wp-content/plugins/wpdatatables/templates/frontend/table_body.inc.php:10

    I hope that helps

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

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

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Cedric replied

    Hi Aleksandar,

    I actually edited that file but still your shortcode output something which not from that file.

    Please the attached file.

    Kind regards,
    Cedric

  • Cedric replied

    wp-content/plugins/wpdatatables/templates/frontend/table_body.inc.php - This is not the right file. Please see the attached file. It's loaded different render not that one.

  • Cedric replied

    Hi Aleksandar,

    Do I need to create another ticket for this? I haven't received any response and delayed to my project. Hopefully someone can help.

    Thank you.

    Kind regards,

    Cedric

  •   Aleksandar replied privately
  • Cedric replied

    Hi Aleksandar,

    Thank you so much for your response and I actually able to achieved my task buy still having problem on mobile with hidden columns.

    Please watch the video below so you will have better understanding about my issue:

    https://vimeo.com/394110822

    Thank you.

    Kind regards,

    Cedric

  •  2,572
    Aleksandar replied

    Hello again Cedric

    You're welcome. What you're doing looks great! Awesome job.

    The selector can't be found because the library is loading them after click. There's a workaround - to open them, and find the selector you need, since you have a custom script that's pulling the data from the first table:

    <script>
    jQuery(window).load(function(){
    if(window.matchMedia("(max-width: 767px)").matches){
            // The viewport is less than 768 pixels wide
           jQuery('.responsiveExpander').each(function() {
      jQuery( this ).click();
    });
        }
    });</script>
    

    You need to find the cell in this script, since they are different classes, so it has to be adjusted.

    I hope that helps.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

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

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Cedric replied

    Hi Aleksandar,

    Okay, will have it try. Also, this call javascript callback

    <script type="text/javascript">
    jQuery(window).load(function(){  wpDataTables.table_1.addOnDrawCallback(  function(){    jQuery('#callback_msg_container').append('Callback triggered!');   })
    });
    </script>

    Why does it only trigger if the logged is administrator role if other role that callback won't trigger.

    Is that the natural behavior of it?

    Kind regards,
    Cedric

  •  2,572
    Aleksandar replied

    Hello Cedric

    It should be triggered at all times, not just when you're logged in as administrator.

    Since this is the case, there are probably some permissions blocking it for non-admin users. You can inspect the page, and see the network response when you're not logged in as administrator. If it returns 403 or 500, it's probably that, so you need to either whitelist wpDataTables from whatever security plugin is blocking the requests, or reach out to your hosting provider and ask them if there's something on the server blocking calls when logged in as anything else other than admin.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

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

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables