Is there a way I can add scroll bar in glide window popup

now_dev
Mega Expert

Hi All,

I am creating glide window pop up in UI action. This popup will display on click of list button. I have a requirement where records should be groupby 'name' field.

But when I use group by, it return all the records in the list instead 5-10 records.

My requirement is to display only 10 records in a popup groupby name and I have tried using "sysparm_force_row_count" but it's not working. However if I remove groupby "sysparm_force_row_count" work perfectly. Since groupby is a part of requirement and I can't remove it, I thought of adding scroll within popup. Any suggestion would be appreciated.

function slots(){

  var gdw = new GlideDialogWindow('show_list');

  gdw.setTitle('Available Slots');

  gdw.setPreference('table','u_test_table_list');

  gdw.setPreference('title', 'Available Slots');

  gdw.setPreference('sysparm_view','default');

  gdw.setPreference('sysparm_force_row_count','10');

  var query = "GROUPBYu_name";

  gdw.setPreference('sysparm_query', query);

  gdw.render();

}

8 REPLIES 8

Thanks Slava for the information. Since we cannot do much about glidemodel size, is it possible to display first 10 groups?


Actually I want scroll to appear vertically but when I increase the width, it automatically increase the height of the popup.


h, could you please share the code how you have added scroll bar how you glide window

In my opinion, the proper way to do this would be to make your query more specific. Assuming that your Date field is of type Date, you could use GlideAggregate to find out the Date value of the 10th group and then pass it to the GlideModal as an encoded query inside sysparm_query preference, so that any records with a greater Date are filtered out. Note that GlideAggregate is only available server-side, so you will need to write a client-callable Script Include and use GlideAjax to call it from your client-side script.



Another possibility, if you needed just the next X dates from today (or from any other specific date), would be to use the DurationCalculator (with or without a Schedule) in combination with a scripted Dynamic FIlter Option. This is likely to be more complicated than the first solution in terms of implementation but could still be worth it, especially if you were to re-use this feature in many places throughout the platform.


I cannot filter on the basis of dates. I have created one appointment booking application and this list of records in pop up is actually available list of appointments which are groupby date, so that user can see what all the appointments are available for given date.



The only challanege I am facing is if Admin creates large number of appoinment(which could be any number 50, 100, 1000), my pop up display all the those group records which is affecting the height of the popup.