• Resolved chriskar07

    (@chriskar07)


    im currenntly using two buttons to filter the table as shown below

    <button class=”table-4-filter” data-filterterm=”male”>male</button></th>
    <button class=”table-4-filter” data-filterterm=”female”>female</button>

    for some weird reason i cannot use dropdown because of interference with my themes css
    anyway..

    what is the equivalent with an select option type?
    for instance to get something like this to filter?i cant seem to find
    the url …./ rem.php?”search filter = ” , command

    <<form action=”/rem.php”> <!– here especially! –>
    <select name=”genre”>
    <option value=”male”>male</option>
    <option value=”female”>female</option>
    </select>
    <input type=”submit” value=”Submit”>
    </form>

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

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    You don’t need a URL for this, as this filtering works directly in the browser, without sending a request back to the server.
    Instead, you will need to adapt the JavaScript code that is in the Button Filter Extension, so that it reads your selected value from the dropdown and uses that for the filtering.

    Regards,
    Tobias

    Thread Starter chriskar07

    (@chriskar07)

    hey Tobias
    thank you for your reply

    could you kindly give an example of what it would look like?

    thank you for your time!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    not really, sorry. I can only suggest that you try to understand and adapt the JS code of the current Button Filter.

    Regards,
    Tobias

    Thread Starter chriskar07

    (@chriskar07)

    ok cool i understand! thanks!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! I hope that you can find a good solution!

    Best wishes,
    Tobias

    Thread Starter chriskar07

    (@chriskar07)

    im still trying with no succesful results, could you please give me a hint
    on how to change the button filter to accept value on submit?

    
    var {$name} = {$command};
    $( 'body' ).on( 'click', '.table-{$table_id}-filter', function() {
    	{$name}.search( $( this ).data( 'filterterm' ) ).draw();
    } ); 
    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    sorry for the long wait, as I was on holidays, I could not reply earlier.

    Sorry, this is beyond what I can help with at the moment. It’s been a while since I wrote that JS code, so that I would first have to understand what I did there again. You would probably have to use a different jQuery event listener and then retrieve the selected dropdown value.

    Regards,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Option filter /button filter’ is closed to new replies.