• Resolved theburnerturner

    (@theburnerturner)


    Hello,

    First off, you thought of almost everything with this plugin. Already gave it 5 stars. Just when I think it can’t do something, I find a support topic that shows me how.

    However, the one thing I can’t figure out, for some reason, is how to enter a second custom command. What do I need to insert between two commands to make sure they both work.

    For example, i already have this custom commanded entered:

    "aaSorting": [[12,'desc']]

    and I want to also add this custom command right after it:

    "aoColumnDefs": [ { "aSearchable": false, "aTargets": [ "_all" ] }, { "b

    Thanks a ton! Such an amazing product!

    https://www.ads-software.com/extend/plugins/tablepress/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your question. Nice to hear that you like TablePress so much! ??

    You’ll just need to combine these two commands with a comma, like

    "aaSorting": [[12,'desc']], "aoColumnDefs": [ { "aSearchable": false, "aTargets": [ "_all" ] }, { "b

    (Note that your second command is broken at the end, but that might just be a copy/paste issue.)

    Regards,
    Tobias

    Thread Starter theburnerturner

    (@theburnerturner)

    You are insanely awesome. You reply fast, your super awesome to all who ask you questions, even those that don’t ask in nice ways. Keep it up man. The work you do is impressive.

    So my last question, or follow-up question, is:

    If I want the second custom code to make it so that my Search only searches column 1, what would the second code be then? Thanks again!

    Thread Starter theburnerturner

    (@theburnerturner)

    I think i got it, is this entire line correct then?

    “aaSorting”: [[12,’desc’]], “aoColumnDefs”: [ { “bSearchable”: false, “aTargets”: [ “_all” ] }, { “bSearchable”: true, “aTargets”: [ 0 ] } ]

    Edit: Actually, I checked, it doesn’t sort by column one with that code above, what is missing? The first custom command is for auto sort, the second i want to only search column one when using the search field.

    Thanks, again!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for the nice words, I really appreciate it!
    (In case you haven’t, you can review TablePress at https://www.ads-software.com/support/view/plugin-reviews/tablepress Thanks a lot! ?? )

    Yes, that “Custom Command” looks correct. It will perform an initial descending sort on column 13, and allow the user to only search in column 1.

    Regards,
    Tobias

    Thread Starter theburnerturner

    (@theburnerturner)

    But, the second custom command is wrong I think. I entered it wrong, because even with a comma entered to separate the two, the search feature doesn’t work in column 1 (0) the way i have it entered.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    you might have to flip the order. To investigate this, could you please post a link to the page with the table? Thanks!

    Regards,
    Tobias

    Thread Starter theburnerturner

    (@theburnerturner)

    I swapped them, but it still won’t allow for sorting of just column 1.

    https://draftcalc.com/test/

    The reason I need column 1 to only be involved in the search is because doing a TE search for example will bring up a few players that have TE in their name or TE in the team column.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for the link.

    It might be possible that DataTables no longer allows the combination of using the same parameter twice. Therefore, we can simply use the other syntax for this:

    "aaSorting": [[12,'desc']], "aoColumnDefs": [ { "bSearchable": false, "aTargets": [ 1,2,3,4,5,6,7,8,9,10,11,12 ] } ]

    Could you please try that?
    Regards,
    Tobias

    Thread Starter theburnerturner

    (@theburnerturner)

    Wow. Perfect!

    Thanks. Do you have other products? You rock, dude. I already gave it 5 stars, but I’ll review it now as well.

    Thread Starter theburnerturner

    (@theburnerturner)

    Feel free to test that link again, to make sure it didn’t do anything else funky. You rock.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    great to hear that this did it!
    I can confirm that your table now works nicely, and that the search only searches the first column ??

    And no, I don’t have other plugins. TablePress is enough fun already ??

    Best wishes,
    Tobias

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Entering two different 'custom commands'?’ is closed to new replies.