CA Service Management

  • 1.  JavaScript to insert (prepend) wildcard for Category searches

    Posted Jan 28, 2014 11:53 AM

    SDM r12.7 C1

    We already have the web_wildcard_search option enabled, which automatically appends the wildcard "%" to all text field search filters.

    The top tiers for request/incident areas are based on the service provided, (Applications, Software, Facilities, Data Comm, etc).  We have a large number of 'second tier' categories, mostly Applications.

    Although the hierarchy tree is very clean, we want to make finding the category as easy as possible. All 'power users' know to start their search by putting the '%' wildcard at the beginning of the key word, but we would like for this to happen automatically when the user tabs out of the Incident Area field (Employee interface).

    I would expect to add a function on the onBlur event for the field, but I am not sure how to capture, update and then return the whereclause variable to the existing search function when a user tabs out of the field.

    Has anyone else tried this?

    thanks,

    jw1



  • 2.  RE: JavaScript to insert (prepend) wildcard for Category searches

     
    Posted Feb 03, 2014 02:08 PM
    jw1:

    SDM r12.7 C1

    We already have the web_wildcard_search option enabled, which automatically appends the wildcard "%" to all text field search filters.

    The top tiers for request/incident areas are based on the service provided, (Applications, Software, Facilities, Data Comm, etc).  We have a large number of 'second tier' categories, mostly Applications.

    Although the hierarchy tree is very clean, we want to make finding the category as easy as possible. All 'power users' know to start their search by putting the '%' wildcard at the beginning of the key word, but we would like for this to happen automatically when the user tabs out of the Incident Area field (Employee interface).

    I would expect to add a function on the onBlur event for the field, but I am not sure how to capture, update and then return the whereclause variable to the existing search function when a user tabs out of the field.

    Has anyone else tried this?

    thanks,

    jw1


    Hi All,

    Any input here for JW?

    Thanks!

    Chris



  • 3.  Re: JavaScript to insert (prepend) wildcard for Category searches

    Posted Mar 26, 2018 12:50 PM

    Any solution to the above question?



  • 4.  Re: JavaScript to insert (prepend) wildcard for Category searches

    Posted Mar 27, 2018 11:24 AM

    Raimundo,

    You would have to customize the javascript autosuggest.js library by writing it to the $ NX_ROOT / SITE / MODS / WWW / WWWROOT / SCRIPTS folder and making the following change:

     

    "jq.get(generate_url('"+element_id+"'),\""+ autosuggest_arr[element_id].autoComplete_parameter+"=%25\"+term+\"%25\",";



  • 5.  Re: JavaScript to insert (prepend) wildcard for Category searches

    Posted Mar 27, 2018 02:04 PM

    Daniel,

    I made the suggested change, but it does not add the % before the terms. I saw in the browser that the autosuggest.js file comes to the browser with the changed files, but the% parameter is not placed at startup. Any suggestions for anything?

    Thankful,
    Raimundo



  • 6.  Re: JavaScript to insert (prepend) wildcard for Category searches

    Posted Mar 27, 2018 02:34 PM

    You must clear your browser cache for changes to this library to take effect.

     

    Replace the line:

    +"var term = nx_escape(request.term);"    
    +"jq.get(generate_url('"+element_id+"'),\""+ autosuggest_arr[element_id].autoComplete_parameter+"=\"+term+\"%25\","

     

    And check in the browser console window to verify that no javascript error is occurring.