Guide / Help Center theme - Unable to filter on ticket status

4 Comments

  • Ben Richards
    Comment actions Permalink

    Example:

    0
  • Socorro Fernandez
    Comment actions Permalink

    Hi Ben,

     

    Posting the JS part in regards to this functionality for your reference:

     

    // Submit requests filter form in the request list page
    $("#request-status-select, #request-organization-select")
    .on("change", function() {
    search();
    });

    // Submit requests filter form in the request list page
    $("#quick-search").on("keypress", function(e) {
    if (e.which === 13) {
    search();
    }
    });

    function search() {
    window.location.search = $.param({
    query: $("#quick-search").val(),
    status: $("#request-status-select").val(),
    organization_id: $("#request-organization-select").val()
    });
    }

    Also compare the html for the requests_page.hbs, specifically this code found after the header and before the requests divider:

    </header>

    {{#form 'requests_filter' class='requests-table-toolbar'}}
    <div class="search">
    {{input 'query' id='quick-search' type='search' class='requests-search'}}
    </div>
    {{#if help_center.multiple_organizations_enabled}}
    <div class="request-table-filter">
    {{label 'organization' for='request-organization-select' class='request-filter request-filter-label'}}
    {{select 'organization' id='request-organization-select' class='request-filter'}}
    </div>
    {{/if}}

    <div class="request-table-filter">
    {{subscribe}}
    </div>

    <div class="request-table-filter">
    {{label 'status' for='request-status-select' class='request-filter request-filter-label'}}
    {{select 'status' id='request-status-select' class='request-filter'}}
    </div>
    {{/form}}

    {{#if query}}
    <div class="requests-search-info meta-data">
    {{t 'requests_search_results_info' count=requests.length query=query}}
    </div>
    {{else}}
    {{#unless requests}}
    <p class="no-activities">{{t 'no_requests'}}</p>
    {{/unless}}
    {{/if}}

    <div class="requests">
    {{#if requests}}

    The part I bolded I believe drives which tickets are shown on the table when a status is selected, assume the page is refreshing after a status is selected.

    Let me know if you are still running into issues here.

    0
  • Ben Richards
    Comment actions Permalink

    Hi Socorro, 

    Thanks for the help. Unfortunately its still not working right :(

    It works absolutely fine on the my requests tab, just not the requests im cc'd on or Organization requests tab...

    It doesnt seem that the page is refreshing when selecting the different statuses 

    There were a few subtle differences in the code snipets you provided to mine, but I changed them and it had no impact.

     



     

     

     

    0
  • Socorro Fernandez
    Comment actions Permalink

    Hi Ben,

    I did have a mistake in my JS code, I updated the bold part where it said focus and it should be change:

     // Submit requests filter form in the request list page
    $("#request-status-select, #request-organization-select")
    .on("change", function() {
    search();
    });

    If the page is not refreshing like when you are in the My Request tab, maybe switch the drop down and refresh the page manually to see if this does anything. 

    Also, go ahead and preview the Copenhagen theme to confirm the functionality is working their for you, will at least confirm that it is something in the code of your site if it works there.

    0

Please sign in to leave a comment.

Powered by Zendesk