Home Analyst Portal
Options

Configure length/size/amount of results for a query result user prompt

Aaron_BoockAaron_Boock Customer Advanced IT Monkey ✭✭✭

Is there a way to control how many query results are returned, using pages (arrows) to reach additional / overflow results?

The case for me is selecting users.  Even when typing part of a user's name, there are still many results.  Limiting users displayed to 5 per page would save me space / real estate on the form.

Best Answers

  • Options
    seth_coussensseth_coussens Member Ninja IT Monkey ✭✭✭✭
    Answer ✓
    I'm thinking you'd put something like this in your custom.js file:

    $(document).ready(function (){
    	//set request offering grids to 5 items per page
    	if(href.indexOf("ServiceCatalog/RequestOffering") > -1){
    		console.log("I'm setting the grids to 5 items per page.");
    		$('[data-role=grid]').each(function (index){
       			$(this).data('kendoGrid').dataSource.pageSize(5);
    		});
    	}
    });
    That should set the grids on a request offering page to show a max of 5 items per page

Answers

  • Options
    seth_coussensseth_coussens Member Ninja IT Monkey ✭✭✭✭
    While you can't really do that in the prompt itself, you can use filter criteria prior to the prompt to filter the results further.

    Basically, you'd add 1 - 2 text fields before the query prompt (think first name, last name), then you can use the information entered into those fields (called tokens) within your query prompt criteria. This would filter the results by both fields prior to even getting down to the query prompt itself.
  • Options
    Aaron_BoockAaron_Boock Customer Advanced IT Monkey ✭✭✭
    edited May 2016
    Any controls available for displayed size of the query results on the request form?
  • Options
    seth_coussensseth_coussens Member Ninja IT Monkey ✭✭✭✭
    I'm assuming you mean the number of results returned? Or do you mean the sizing of the text and rows?
  • Options
    Aaron_BoockAaron_Boock Customer Advanced IT Monkey ✭✭✭
    Yes, results returned. 
  • Options
    seth_coussensseth_coussens Member Ninja IT Monkey ✭✭✭✭
    Answer ✓
    I'm thinking you'd put something like this in your custom.js file:

    $(document).ready(function (){
    	//set request offering grids to 5 items per page
    	if(href.indexOf("ServiceCatalog/RequestOffering") > -1){
    		console.log("I'm setting the grids to 5 items per page.");
    		$('[data-role=grid]').each(function (index){
       			$(this).data('kendoGrid').dataSource.pageSize(5);
    		});
    	}
    });
    That should set the grids on a request offering page to show a max of 5 items per page
  • Options
    Aaron_BoockAaron_Boock Customer Advanced IT Monkey ✭✭✭
    edited May 2016
    Cool, thats very helpful, and I consider an answer to my question. Additional logic could be added to only apply to a particular request offering page (as an alternative to all request offering pages) ?
  • Options
    seth_coussensseth_coussens Member Ninja IT Monkey ✭✭✭✭
    No problem. Welcome to the community.
  • Options
    Aaron_BoockAaron_Boock Customer Advanced IT Monkey ✭✭✭

    Hi Seth, when testing the javascript snippet, my portal pages load blank.  Does this feedback indicate any potential modifications that I could re-evaluate?

Sign In or Register to comment.