WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] Customization of colum filters dropdown (20 posts)

  1. poojith
    Member
    Posted 1 year ago #

    Hi TobiasBg

    Can we show custom order for filter drop-down list, Now what happened is the Month List dropdown is showing random order
    ex: { Apr, Aug, Dec} instead of this can we show this in
    ( Jan, Feb, Mar, Apr) like that ?

    http://wordpress.org/extend/plugins/tablepress/

  2. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    thanks for your post! As I have already answered via email:
    Sorry, I don't know a solution to that :-( This would have to be
    changed in the external JavaScript code of the ColumnFilterWidgets,
    but unfortunately, I don't know how to do that :-( The sorting is
    always alphabetical by default.

    Regards,
    Tobias

  3. poojith
    Member
    Posted 1 year ago #

    Thanks for your reply.

    I tried the below code but it not work

    $('#tablepress-2_wrapper').dataTables_wrapper()
    .columnFilter({
    aoColumns: [ { type: "select", values: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] },
    { type: "text" },
    null,
    { type: "number" },
    { type: "select" }
    ]

    });

    I found this from the below link,

    http://jquery-datatables-column-filter.googlecode.com/svn/trunk/customFilters.html

  4. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    that code is not for the ColumnFilterWidgets library, but for a different one, the "Column Filter". Also, the correct code would have to be

    $('#tablepress-2').dataTables().columnFilter( {
      aoColumns: [
        { type: "select", values: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] },
        { type: "text" },
        null,
        { type: "number" },
        { type: "select" }
      ]
    } );

    That of course would only work for a table with the same structure (5 columns) as in the example table in the link.

    Regards,
    Tobias

  5. poojith
    Member
    Posted 1 year ago #

    HI TobiasBg

    The month sorting issue is solved, i changed some lines in the jQuery file ColumnFilterWidgets.js

     if (widget.bSort && select_title != 'Month') {
                    if (widget.hasOwnProperty('fnSort')) {
                        aDistinctOptions.sort(widget.fnSort);
                    } else {
                        aDistinctOptions.sort();
                    }
    

    Now everything is working perfectly. Also changed the drop down filter multi selecting option, now it will come inside the select box.

    http://www.inpressadv.net/staging/blueocean/final/courses-calendar/

  6. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    ah, very nice! Thanks for sharing this! Hopefully, this will be helpful to others as well!

    Best wishes,
    Tobias

  7. stanley007
    Member
    Posted 7 months ago #

    Hi TobiasBg

    Your plugin rocks dude.However now im facing a problem in filtering.My client dosnt need the text(selected item) which comes down in droapdownlist area..

    2.when i select one university that particular university must be show..other options showld not show..

    aslike Poojith's table i must get dude..

    Please help me out dude..

    below is my website link
    http://krystl.co

    username:center1
    password:center1

  8. TobiasBg
    Member
    Plugin Author

    Posted 7 months ago #

    Hi,

    thanks for your question.

    You can hide that text with some CSS very easily:

    #tablepress-123_wrapper .column-filter-widgets .filter-term {
      display: none;
    }

    (Change the 123 to the correct table ID.)

    However, you should keep in mind that the user then does not have a way to select something else.

    Regards,
    Tobias

  9. stanley007
    Member
    Posted 7 months ago #

    Thanks for the reply TobiasBg..

    What i want exactly is like below link.

    http://www.inpressadv.net/staging/blueocean/final/courses-calendar/

    please i want exactly the same..

  10. TobiasBg
    Member
    Plugin Author

    Posted 7 months ago #

    Hi,

    sorry, you will then have to speak to poojith directly. It seems that he has made some special customizations and modifications to the JavaScript code, but I'm not familiar with them.

    regt

  11. stanley007
    Member
    Posted 7 months ago #

    Where can i get the tablepress- datatables-multi-filter-select plugin..

  12. TobiasBg
    Member
    Plugin Author

    Posted 7 months ago #

    Hi,

    that's available at http://tablepress.org/extensions/multi-filter-select/

    Regards,
    Tobias

  13. stanley007
    Member
    Posted 7 months ago #

    Should i uninstall other extensions? And after install in wordpress any other changes should i do?

  14. TobiasBg
    Member
    Plugin Author

    Posted 7 months ago #

    Hi,

    I'm confused now. As I just said: http://tablepress.org/extensions/multi-filter-select/

    Regards,
    Tobias

  15. stanley007
    Member
    Posted 7 months ago #

    Should i uninstall other extensions? And after install in wordpress any other changes should i do?

  16. TobiasBg
    Member
    Plugin Author

    Posted 7 months ago #

    Hi,

    no, you should not have to uninstall other Extensions. Just be aware that not all Extensions work together, because they change the same piece of JavaScript code.

    To activate the Extension, extend your table's Shortcode to

    [table id=123 datatables_multi_filter_select=true /]

    Regards,
    Tobias

  17. stanley007
    Member
    Posted 7 months ago #

    Thankq once again TobiaBg

    how can i exclude columns? And how can i place the dropdown in header?

  18. TobiasBg
    Member
    Plugin Author

    Posted 7 months ago #

    Hi,

    sorry, that's both not possible with this Extension. You will have to modify the JavaScript code of the Extension yourself to achieve this.
    It just is not as flexible as the ColumnFilterWidgets Extension.

    Regards,
    Tobias

  19. stanley007
    Member
    Posted 7 months ago #

    Hmm Actually im also new to Javascript.And also new in WordPress.Anywayz appreciate for your quick replies :)

  20. TobiasBg
    Member
    Plugin Author

    Posted 7 months ago #

    Hi,

    sure, no problem. Maybe that's a good way to start getting deeper into programming :-)

    Best wishes,
    Tobias

    P.S.: In case you haven't, please rate TablePress here in the plugin directory. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.