SharePoint 2016 list dialog height get shortened

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1963
    sam
    Participant

    I activated the solution and found that the dialog pop up height for the list get shortened with scroll bar. This only happened with no SPEasyForm configured on the list, I mean nothing being done on the list and if there’s some configurations like adding Tab, it tooks sometimes for the dialog pop up to lengthened.

    #1964
    Joe McShea
    Keymaster

    I haven’t seen that, but I don’t do a lot of forms in dialogs. I’ll take a look when I get a chance.

    Joe

    #1965
    Joe McShea
    Keymaster

    OK, now I’ve seen it, and it happens on SharePoint online too (and probably all versions of SharePoint).

    It’s because I hide the form table until I can determine if it has an SPEasyForms configuration, and then if it doesn’t I show it without checking if it’s a dialog. In the interim, SharePoint continues rendering the dialog and sizes it too small because the form table is hidden, so it doesn’t make any room for it. I do the hiding and showing using Client-side rendering, but at the point in the page life cycle where I set that up, I don’t have enough context available to determine if it has an SPEasyForms configuration.

    The ideal fix would be don’t even hide the form if there is no SPEasyForms configuration. I’m not sure I can work that out, but if not I can certainly check if I’m in a dialog when I show it and resize the dialog then, just like I do when and SPEasyForms configuration is applied (as you observed with tabs etc.).

    This may take a little while to sort out, but I should be able to come up with a reasonable fix. I’ll let you know when I figure something out.

    Joe

    #1974
    hzynst
    Participant

    Hello ! I just came across the shortened dialog Forms this morning after installing EasyForms with a new group. This group has 50 sites in their site collection and love to use GridViews and Dialog Forms … I, of course, was using the “standard” full form …

    An hour after installing EasyForms the phone started ringing off da’Hook! Why is my dialog form so short!! I had to laugh at that …..

    Seeing as how *ANY* EasyForms config I do will always be for non-dialog forms… Might there be a shim I could put into the code (short term until final fix is generated) whereby I can check to see if the form is dialog and exit Easyform if found to be in dialog?

    I have a demonstration to give on Friday … I would like to show off EasyForms without causing too much pain to the others….

    #1975
    hzynst
    Participant

    Hi Joe –

    Would you be able to tell what the element is that is being hidden/display adjusted (dialog forms)?

    I’d like to experiment with a .js added to Custom User Actions to load after SPEF that will look for IsDlg in the URL and setInterval to unhide/display the element for dialog forms…

    As always … Love Love Love EasyForms and all your efforts and help over the (now) years I’ve been using EasyForms !!!!!

    Thanx
    Jeff

    #1976
    Joe McShea
    Keymaster

    Hi Jeff,

    I’m inserting the following style, using a CSS OnPreRender handler, so it gets inserted just before SharePoint starts rendering the form.

    <style type='text/css'>.ms-formtable { display: none; }</style>

    This hides the table element with class ms-formtable. The tricky part will be the timing.

    I think I do have a fix for this issue, but I need to do more testing and haven’t had a lot of time to work on it.

    I’d also like to make it so you can configure SPEasyForms to not hide the table at all, in which case SPEasyForms forms might load a bit jumpy, but non-SPEasyForms would load as normal, at your option. The default would still be to load as it does now (with the fix for dialogs of course).

    I’ll get out a fix as quick as I can. In the meantime, if you come up with a user custom actions fix, let me know.

    Joe

    • This reply was modified 1 year, 3 months ago by Joe McShea.
    #1983
    hzynst
    Participant

    Hey Joe –

    Thank you for the response … I did do some more digging … I sent you an email to your Gmail account …

    I did find after the dialog form was up and ready (albeit foreshortened with the original ms-formtable showing … scrunched with scrollbars), executing an SP.UI.ModalDialog.get_childDialog().autoSize() would return the dialog form to “normal” SP dialog sizing…

    All appears to work well if the SP Form is full-page (non-dialog) without SPEF config file for that list (spef-layout(listId).txt) …

    Not fully understanding where the code checks for the existence of / contains information in the spef-layout file and then backs out …

    Just to check and make sure … there wouldn’t be a timing issue … a setTimeout being used on a dialog resize or something like that … asking because I would swear it would be a-OK once then fall into the fore-shortened dialog after that …. but my eyes have been known to play tricks o me after looking at windows and tabs for hours…

    Thank you again for all of your efforts !!! Long live SPEF !
    Jeff

    #1985
    hzynst
    Participant

    Hello Joe –

    I did some more detective work and came up with a small script that can be placed into the Custom User Actions … to assist in resizing SP dialog forms… I put the script at sequence 58000

    Not the prettiest code .. but functional

    Please test, test, test in your environment(s) before “going live”!

    
    function stopCheckingIsDlg4spef(){
    	
    	console.log("stopCheckingIsDlg4spef(): Clear setInterval myVar...");
    	clearInterval(myVarSpef);
    }
    
    function startCheckingIsDlg4spef(){
    	
    	console.log(".ready(): startCheckingIsDlg4spef(): setInterval myVarSpef...");
    	console.log("href = " + window.location.href);
    	
    	if(((window.location.href).toLowerCase()).indexOf('form.aspx') < 0 || (window.location.href).indexOf('IsDlg') < 0)
    	{
    		console.log("startCheckingIsDlg4spef():  Not a SharePoint Dialog New | Disp | Edit form ... exiting function....");
    		return false;
    		
    	};
    	
    	countCheckingIsDlg = 0;
    	
    	myVarSpef = setInterval(function(){ 
    
    	if((window.location.href).indexOf('IsDlg') >= 0)
    	{
    		console.log(".ready(): startCheckingIsDlg4spef(): FOUND IsDlg ... Checking and resize modal form!");
    		stopCheckingIsDlg4spef();
    		SP.UI.ModalDialog.get_childDialog().autoSize();
    
    	}
    	else
    	{
    		console.log(".ready(): startCheckingIsDlg4spef(): Waiting for SPEF... ");
    		countCheckingIsDlg += 1; 
    		console.log("startCheckingIsDlg4spef(): valueof countCheckingIsDlg = " + countCheckingIsDlg);
    		if(countCheckingIsDlg > 5)
    		{
    			console.log("startCheckingIsDlg4spef(): Counter countCheckingIsDlg expired... stop checking");
    			stopCheckingIsDlg4spef();
    		};
    	};
    
    	}, 1500);
    
    }
    
    //using spef format ... assuming being used with SPEF already
    spefjQuery(window).bind('load',function(){startCheckingIsDlg4spef();});
    
    //regular jquery format
    //---------------------------------------------------------------------DR
    //$(document).ready(function() {
    
    //	startCheckingIsDlg4spef();
    
    //}); // document.ready
    //----------------------------------------------------------------------DR
    

    Thanx!
    Jeff

    • This reply was modified 1 year, 3 months ago by hzynst.
    #1994
    Joe McShea
    Keymaster

    Hi Jeff,

    Nice. I’m still working on a fix, but not finding much time to work on it. Hopefully, I’ll release something before May is done.

    Joe

    #2066
    Joe McShea
    Keymaster

    This has been fixed in 2018.04…and only about 5 months later than I originally said…sorry.

    Joe

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.
Scroll to top