How can i maintain pagination with filter using tableselect? I am creating listing of content using tableselect form type like as follow.    

function partners_list($form,&amp;$form_state){
        $header = array(
            'name'=&gt;array('data' =&gt; t('Name'),'field' =&gt; 'ept.name'),
            'location'=&gt;array('data' =&gt; t('Location'),'field' =&gt; 'ept.location'),
        );

        $form['search_ew_partner'] = array(
            '#type' =&gt; 'textfield',
            '#prefix' =&gt; '&lt;div class="serachOuter "&gt;&lt;div class="grayBg"&gt;&lt;div class="searchInner clearfix"&gt;&lt;div class="searchField pull-left"&gt;',
            '#suffix' =&gt; '&lt;/div&gt;',
            '#default_value'=&gt; $form_state['values']['search_ew_partner'],
            '#attributes' =&gt; array(
                'placeholder' =&gt; 'Search by name'
            )
        );

        $form['submit'] = array(
            '#type' =&gt; 'submit',
            '#value' =&gt; t('Search'),

            '#prefix' =&gt; '&lt;div class="btnOuter clearfix"&gt;',
            '#suffix' =&gt; '&lt;a href="/partners/list" class="btn grayBtn"&gt;Reset&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;',

            '#attributes' =&gt; array(
                'class' =&gt; array('btn blueBtn')
            )
        );

        if(empty($form_state['input'])){
            $results = partners_list_submit($form,$form_state);
            $results=$results['filter_result'];
        }else{
            $results=$form_state['filter_result'];
        }

        $options = array();
        if(!empty($results)){
            foreach($results as $result){
                $options[$result-&gt;id] = array(
                    'name' =&gt; array('data' =&gt; array('#type' =&gt; 'link', '#title' =&gt; $result-&gt;name, '#href' =&gt; "partner/details/".$result-&gt;id)),
                    'location' =&gt; ucfirst($result-&gt;location),
                );
            }
        }      

        $form['ew_partners'] = array(
            '#type' =&gt; 'tableselect',
            '#header' =&gt; $header,
            '#options' =&gt; $options,
            '#empty' =&gt; t('No partners.'),
            '#attributes' =&gt; array(
                'class' =&gt; array('table')
            )
        );

        $form['pager'] = array('#markup' =&gt; theme('pager'));        
        return $form;
    }

    function partners_list_submit(&amp;$form,&amp;$form_state){
        $form_state['rebuild'] = true;
        $header = array(
            'name'=&gt;array('data' =&gt; t('Name'),'field' =&gt; 'ept.name'),
            'location'=&gt;array('data' =&gt; t('Location'),'field' =&gt; 'ept.location'),
        );

        $query = db_select('ew_partners', 'ept');
        if(!empty($form_state['values']['search_ew_partner'])){
            $query-&gt;condition('ept.name', '%' . $form_state['values']['search_ew_partner'] . '%', 'LIKE');
        }

        $query = $query-&gt;extend('PagerDefault')-&gt;extend('TableSort');
        $query-&gt;fields('ept',array('id','name','location'));
        $query-&gt;limit(2)
            -&gt;orderByHeader($header);


        $results = $query-&gt;execute();
        $form_state['filter_result']=$results;
        $form_state['no_cache'] = true;
        return $form_state;
    }


Listing and pagination coming properly when there is no filtration on table. After filtration, pagination is not working.
I think due to form_state values are reset when I clicked on next page.
The page count and the result for first page is coming properly.

How can i maintain pagination with filter using tableselect?

Thank you in advance
Any help appreciated.
The search form method type is post thats why when you are submitting the search form the form values are sending as post therefore the form values are coming properly for  first page. When your are clicking on second page the form state values are reseting with new form state values as form has default value.

So rather than using post method form I will suggest to use get method type form for search so that the search keyword will always persist in url.

So you have to add 

$form['#method'] = 'get';


Access all filtered values using $_GET like

$form['search_ew_partner'] = array(
            '#type' =&gt; 'textfield',
            '#prefix' =&gt; '&lt;div class="serachOuter "&gt;&lt;div class="grayBg"&gt;&lt;div class="searchInner clearfix"&gt;&lt;div class="searchField pull-left"&gt;',
            '#suffix' =&gt; '&lt;/div&gt;',
            '#default_value'=&gt; $_GET['search_ew_partner'],
            '#attributes' =&gt; array(
                'placeholder' =&gt; 'Search by name'
            )
        );


And change your code like

if(!empty($_GET['search_ew_partner'])){
            $query-&gt;condition('ept.name', '%' . $_GET['search_ew_partner'] . '%', 'LIKE');
        }