Okay
  Public Ticket #1251371
Checkbox filter updating in front-end
Closed

Comments

  •  1
    VMorgunov started the conversation

    I made a checkbox-type filter for a table column, but it does not work correctly if the table data is updating without reloading the page.  In my case, I update conected MySql table with AJAX and PHP hook, wpDataTable is updating well, but filter list remain with old values.

    How can I update the list of the checkbox filter for the table column using Java Script in front-end?

  •  1,846
    Miloš replied

    Hi VMorgunov,
    Thank you for your purchase.

    Unfortunately something like this is not possible with the plugin build in feature and it require custom coding. We can offer you our paid customization services where you can hire one of our developers to implement this feature for you.

    If you are interested let us know se we can send you a quote for this service.

    Best regards.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    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

  •  1
    VMorgunov replied

    Hi.  Yes I understood that. But I  want to make a handler by my self.  And all I want from  you is just some kind of documentation about using class object. Or advice with main directions and steps. Anyway, thanks for answer. And great job. 

  •  1,846
    Miloš replied

    Hi VMorgunov,

    You can take a look at our documentation which uses like some info for developers.
    You can find some hooks and filters so I hope that it can help you out.

    Best regards.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    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

  •  1
    VMorgunov replied

    Hi Bogdan.  Thanks for the advice, but in the article about hooks and filters I did not find any information about controlling the table in the frontend using JavaScript

  • [deleted] replied

    Hi VMorgunov,

    Bogdan left on vacation and I will take over this ticket. Can you please send me a link of your wpDataTable so I can understood better what do you want to achieve? 

    Did you create custom checkbox filter or you are using built-in wpDataTable checkbox filter?

  •  1
    VMorgunov replied

    Hi, Milos!

    Glad to see you!

    I created a table with a MySQL query and assigned a filter with a checkbox-type to one of the columns. My  MySQL table are updating without reloading the page via Ajax. So, I need that the list of checkboxes in the column filter also update its values. Now this does not happen and I asked for help. Could you help me understand how I can interact with the 'wpDataTables' object to update the list of filter checkboxes using Javascript? Unfortunately, I can not give you access to a working project, so I specially created a test case to show you.

    http://cscl-reporter.com/en/reports/table-report-by-coffeeshops

    But you have to LogIn for acces the report with wpdatatable:

    login: v.morgunov

    password: twsdchk6h

  • [deleted] replied

    Hi VMorgunov,

    As I see from your table, when I click Name checkbox filter, modal is opened but there are not entries. What version of the plugin are you using?

  •  1
    VMorgunov replied

    Hi!

    I use wpDataTables Version 1.7.2
    But I also tested it function in Beta wpDataTables 2.0 

    There is a same problem too. The list of checkboxes is not empty there, but It also not updating without reloading the page.

  • [deleted] replied

    Hi VMorgunov,

    Can you please explain me in more details what do you mean by updating list of checkboxes? Can you please provide some example or some screenshot? As you can see from our documentation possible values for filter and for editor input types can be populated in three different ways - Link.

    Possible values for column – this input defines how the possible values for this column will be listed. Possible values are used in the filters (selectbox, checkbox) and in the editor inputs for editable tables. The options are:

    • Read from table on page load (default) – possible values will be fetched from the table every time the table is open in front-end. Works fine if all the values are already there, but may be not a good solution for tables which aren’t filled in yet, also may work slow for large tables, as it performs a full table read every time.
    • Define values list – opens an additional tag-like input where you can enter manually all the possible values for this column, separated by comma or Enter. This input also allows reading the existing values from the table.
    • Use values from another table (Foreign key) – allows configuring a relation to another wpDataTable, for example to show user names from a users table, instead of user ids. Please read the full tutorial on configuring table relations / foreign keys to see how this works.

    Also I suggest you to update the plugin to version 2.0.1 because there are a lot new features about filters and other 

  •  1
    VMorgunov replied

    Hello, Milos! You said: "Also I suggest you update the plug-in to version 2.0.1, because there are many new features about filters and others."

    But I was informed that version 2.0. is not allowed for commercial use.
    Have the terms of use changed?
    In the attachment, a file with screenshots and description.

    And thank You very much for Your help!

    Vitaly


  •  1
    VMorgunov replied

    And could you say, how I can update the plugin to version 2.0.1?

  • [deleted] replied

    Hi VMorgunov,

    1. "But I was informed that version 2.0. is not allowed for commercial use.
    Have the terms of use changed?"

    - Version 2.0 is allowed for commercial use, and it was always. Where you saw that it is not allowed for commercial use?

    2. "And could you say, how I can update the plugin to version 2.0.1?"

    - We didn't yet pushed auto-update, but we plan to do that at the end of the next week. Until that you can update it manually following these instructions:

    1. Go to your FTP and open WordPress plugins folder
    2. Delete the old wpDataTables version folder
    3. Upload the new version of wpDataTables
    4. Go to WP-admin panel, open Plugins section
    5. Deactivate wpDataTables, and then activate it again

    IMPORTANT: Do NOT delete the old version from WP-admin (by clicking “Delete” in the plugins page) if you don’t want to lose all your tables!

    3. I took a look at your issue in .pdf file. Unfortunately something like that is not possible out of the box and it would require some custom coding. We have plans to create add-on for wpDataTable next month that will make filters more powerful. 

    In this add-on, cascading filtering will be included as a feature. That means if you are filtering one column (For example Cars) by some value (For example BMW), Second column (For example Model) filters will be updated just with values of BMW models.  

  •  1
    VMorgunov replied

    Hi!

    Bogdan had told me that I could use new copy for beta testing purposes only..I thought, that it means not for commertial use. 

    Could you give me a link for downloading new version? Last time Bogdan send me a direct link with password for an archive.

    About my request - I just asked more information about JS object of WpDataTable and methods that responce for updating the list of checkboxes of the column filter . Unortunately I didn't find info about checkboxes in JQuery DataTables Plugin site. And your knowlegebase for JS callback is almost empty.

  • [deleted] replied

    Hi VMorgunov,

    "Bogdan had told me that I could use new copy for beta testing purposes only..I thought, that it means not for commertial use. 

    Could you give me a link for downloading new version? Last time Bogdan send me a direct link with password for an archive."

    - You can download newest version at this link https://codecanyon.net/downloads

    "About my request - I just asked more information about JS object of WpDataTable and methods that responce for updating the list of checkboxes of the column filter . Unortunately I didn't find info about checkboxes in JQuery DataTables Plugin site. And your knowlegebase for JS callback is almost empty."

    All logic for filtering and for population filtering values is in file ../wp-content/plugins/wpdatatables/assets/js/jquery-datatables/jquery.dataTables.columnFilter.js

    For checkboxes you can take a look at this function fnCreateCheckbox in this file.

  •  1
    VMorgunov replied

    Thanks a lot, Milos!

  • [deleted] replied

    Hi VMorgunov,

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

  •  1
    VMorgunov replied

    Hi.

    I faced a problem after plugin update.

    The error message appears when I try to configure my tables that was made in previous version of plugin.

    Last time there was the same situation, but after I cleared the browser cashe it started to work correct, but now not activate/deactivate, nor cashe browser clearing didn't  help.

  •  1
    VMorgunov replied

    It seems that I've found the solution. Instead SQL request: SELECT * FROM cms_wp_mv_report_102 WHERE user = '%VAR1%'  (It worked in previous version fine)

    I write: 

    SELECT * FROM cms_wp_mv_report_102 WHERE cms_wp_mv_report_102.user = '%VAR1%'

  • [deleted] replied

    Hi VMorgunov,

    I am glad that you find the solution for the issue.