• Resolved locomo

    (@locomo)


    Hi,

    I am trying to create a simple search form that searches within a specific column. My approach below is not doing anything – the table never redraws. Any ideas? I can confirm that a search value is being passed in via console.log

    thanks

    var table = $('#tablepress-1').DataTable();
    $('#search-form input').on( 'keyup', function () {
    	console.log(this.value);
    	table
    		.columns( 1 )
    		.search( this.value )
    		.draw();
    } );
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    I’m afraid that I can’t really help here. As this JS code is independent from TablePress, you should try the DataTables support forums here.

    (One thing that often causes headaches: Remember that counting columns in such JS code starts with 0. Thus, your code would search the second column.)

    Regards,
    Tobias

    Thread Starter locomo

    (@locomo)

    ok thanks .. I don’t think it’s an issue with my column count .. it seems like the “draw” method isn’t actually being called for some reason

    anyhow I can try over on the DataTables forums

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    yes, that will be the best. Please let me know if you find a cause or solution here.

    Best wishes,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘custom search form’ is closed to new replies.