JS Open Form in Modal vLookup Issue

Home Forums Classic DFFS JS Open Form in Modal vLookup Issue

Viewing 2 reply threads
  • Author
    Posts
    • #19259
      Kasey
      Participant

        I have a list with DFFS with a vLookup. When I open the Disp/Edit forms normally in modal and add a child record via vLookup I have no issues. However, when I try to use javascript to open the Disp/Edit form in a modal when I create my child item I begin typing in the Title column. The first time I hit the space bar the parent record opens up in a new modal. I have tried both of the below methods to open my form. I’m assuming it has something to do with the pagetype in the URL as I’m using 4 and 6 instead of 5 and 7. Any ideas how to get around this issue?

        This issue was not present in 4.4.2.9. It is happening with 4.4.3.31.

        var URL = $j_site + ‘/_layouts/listform.aspx?PageType=4&ListId=’ + $j_restList + ‘&ID=’ + _finReqID;
        var _function = “EditItem2(null,'” + URL + “‘)”;

        function openModalDialog(LinkURL,LinkTitle) {
        options = SP.UI.$create_DialogOptions();
        options.url = LinkURL;
        options.title = LinkTitle;
        options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
        SP.UI.ModalDialog.showModalDialog(options);
        }

        • This topic was modified 6 years, 11 months ago by Kasey.
        • This topic was modified 6 years, 11 months ago by Kasey.
      • #19263
        Kasey
        Participant

          Does not occur in 4.4.2.9.

          • This reply was modified 6 years, 11 months ago by Kasey.
        • #19266
          Alexander Bautz
          Keymaster

            This sounds strange. Try changing the function like this:

            function openModalDialog(LinkURL,LinkTitle) {
                var options = {
                    "url":LinkURL,
                    "title":LinkTitle,
                    "dialogReturnValueCallback":function(status){
                        if(status === 1){
                            // The dialog item was edited
                        }else{
                           // The dialog item was canceled
                        }
                    }
                };
                SP.UI.ModalDialog.showModalDialog(options);
            }

            Any difference?

            Alexander

        Viewing 2 reply threads
        • You must be logged in to reply to this topic.