- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2020 05:52 PM
i Guys,
I have this simple client UI Action that pops up a GlideModel and populates with major incidents. The problem that I have is eventhough I have set the height but when the dialog pops up it pushs the dialogue based on number of records and total pages which is 20 by default. I have created a custom list view called "dialog_view" that has only limited fields. What I ideally want that the height works correctly and it shows scrollbar if rows exceed. Alternatively, I would like to set the page size in my custom list view to let is say 5 or 10 so I can control the height e.g. for this custom view or through script. Or any other options please?
UI action Code (You should be able to copy and paste and it should work):
function showModal() {
//Initialize the GlideDialog window
var w = new GlideModal('dialog_view', false, 600);
w.setTitle('Major Incidents');
w.setPreference('table', 'incident_list');
w.setPreference('sysparm_view', 'dialog_view');
//Set the query for the list
var num = g_form.getValue('number');
var query = 'active=true^priority=1^number!=' + num;
w.setPreference('sysparm_query', query);
w.setSize(600,600); // Height Not working
//Open the popup
w.render();
}
This is how it looks (Total crap!!):
This is how I want it:
TIA
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2020 07:31 PM
Hi,
Ok, for anyone else who might be having this problem in the future, I managed to handle it this way by limiting the number of rows to 10. The following is the code that works:
The trick was to set this: w.setPreference('sysparm_force_row_count', '10'); // To enable row limit
function showModal() {
//Initialize the GlideDialog window
var w = new GlideModal('dialog_view');
w.setTitle('Major Incidents');
w.setPreference('table', 'incident_list');
w.setPreference('sysparm_view', 'dialog_view');
w.setPreference('sysparm_force_row_count', '10'); // To enable row limit???
//Set the query for the list
var num = g_form.getValue('number');
var query = 'active=true^priority=1^number!=' + num;
w.setPreference('sysparm_query', query);
w.setSize(800, 600);
//w.adjustBodySize();
//Open the popup
w.render();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2020 06:37 PM
See doc that had lot of different ways
https://developer.servicenow.com/dev.do#!/reference/api/orlando/client/c_GlideDialogWindowAPI
Ex:
var gdw = new GlideDialogWindow('show_list');
gdw.setTitle('Test');
gdw.setSize(750,300);
gdw.adjustBodySize();
gdw.render();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2020 06:51 PM
Hi,
It works if you don't have any content on it. Did you try the above code? The behaviour is exactly same as GlideModal!
function showModal() {
//Initialize the GlideDialog window
var w = new GlideDialogWindow('dialog_view');
w.setTitle('Major Incidents');
w.setPreference('table', 'incident_list');
w.setPreference('sysparm_view', 'dialog_view');
//Set the query for the list
var num = g_form.getValue('number');
var query = 'active=true^priority=1^number!=' + num;
w.setPreference('sysparm_query', query);
w.setSize(600,600); // Height Not working
//Open the popup
w.render();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2020 07:31 PM
Hi,
Ok, for anyone else who might be having this problem in the future, I managed to handle it this way by limiting the number of rows to 10. The following is the code that works:
The trick was to set this: w.setPreference('sysparm_force_row_count', '10'); // To enable row limit
function showModal() {
//Initialize the GlideDialog window
var w = new GlideModal('dialog_view');
w.setTitle('Major Incidents');
w.setPreference('table', 'incident_list');
w.setPreference('sysparm_view', 'dialog_view');
w.setPreference('sysparm_force_row_count', '10'); // To enable row limit???
//Set the query for the list
var num = g_form.getValue('number');
var query = 'active=true^priority=1^number!=' + num;
w.setPreference('sysparm_query', query);
w.setSize(800, 600);
//w.adjustBodySize();
//Open the popup
w.render();
}