Search Results for 'list form'

Home Forums Search Search Results for 'list form'

Viewing 15 results - 1,141 through 1,155 (of 1,358 total)
  • Author
    Search Results
  • #11024
    avala
    Participant

      Thanks, Alexander. Yes, I see the alert and it says “vLookup.” I’m using this in the EditForm and not the listview. I tested this and “function vlookupChildViewOrEditCallback(fin) in the DispForm. No changes.

      #11018
      Alexander Bautz
      Keymaster

        Hi,
        Are you sure the field name is correct?

        Try setting it up like this to alert the FieldInternalname:

        function vLookupIsLoadedCallback(fin){
        	alert(fin);
        	if(fin === "vLookup"){
        		CalcTotal();
        	}
        }

        Do you see the alert?

        PS: I’m assuming you use this code in a DispForm of a list and not in a list view?

        Alexander

        #10997
        Alexander Bautz
        Keymaster

          Hi,
          Add this script to a HTML form web part or a Script editor web part in a list view of the list you want to update. You must change the script src to the two scripts.:

          <label>From column </label><input type="text" id="spjs_colA" value=""> <label>To column </label><input type="text" id="spjs_colB" value=""> <input type="button" onclick="doUpdateColumn()" value="Copy val from col A to col B">
          <script type="text/javascript" src="https://spjsblog.sharepoint.com/DFFS/SPJS/jquery-1.11.1.min.js"></script>
          <script type="text/javascript" src="https://spjsblog.sharepoint.com/DFFS/SPJS/DFFS/spjs-utility.js"></script>
          <script type="text/javascript">
          
          function doUpdateColumn(){
          	var a = $("#spjs_colA").val(), b = $("#spjs_colB").val(), res, uRes, data, count = 0;
          	if(a === "" || b === ""){
          		alert("Please fill in both fields");
          	}else{
          		if(!confirm("Write the value from column \""+a+"\" to column \""+b+"\"?\n\nPlease note that the page will FREEZE while this operation runs. If you want to follow the progress, open a new brower window and use this to look at the progress by inspecting columne \""+b+"\" for change.")){
          			return;
          		}
          		res = spjs_QueryItems({"listName":_spPageContextInfo.pageListId,"query":"<Where><IsNotNull><FieldRef Name='"+a+"' /></IsNotNull></Where>","viewFields":[a,b]});
          		$.each(res.items,function(i,item){
          			if(item[a] !== item[b]){
          				data = {};
          				data[b] = item[a];
          				uRes = spjs_updateItem({"listName":_spPageContextInfo.pageListId,"id":item.ID,"data":data});
          				if(!uRes.success){
          					alert(uRes.errorText);
          					return false;
          				}else{
          					count += 1;
          				}
          			}
          		});
          		alert("Done updating "+count+" items.");
          		location.href = location.pathname;
          	}		
          }
          </script>

          Hope this gets you started.

          Alexander

          • This reply was modified 9 years, 1 month ago by Alexander Bautz. Reason: Removed default values in inputs
          #10990
          Alexander Bautz
          Keymaster

            Hi,
            I’m not 100% sure which solution you are referring to – is it this one? https://spjsblog.com/2015/05/18/approve-or-reject-list-items/

            The GetUrlKeyValue function is used in a form and not a list view – and please note that running a debug window in a form in a dialog might not work (open it in the root page an not in a dialog).

            Alexander

            #10949
            Alexander Bautz
            Keymaster

              If this is a one time operation, using DataSheet / quick edit would possibly by easiest?, but the script to do this update is quite easy to write.

              Basically you need to query all items with the correct value in the “donor” field, and iterate over these to set the value in the new field.

              I can create this script, but the performance depends on how many items you have in the list – can you give me a ballpark figure on the item count?

              Alexander

              #10932
              Lana
              Participant

                Hi,
                Lets go at this from another perspective. I want to add a column to a list, use a rule to Set Default Value to equal another field on the form….how do I get that to implement for the whole list, without opening and saving each item in the list?
                Thanks!
                Lana

                #10913
                Carl E Tippins
                Participant

                  The “_spPageContextInfo” did display the ListID information correctly.
                  After I verified the ListID was present, and while I still had the Console open, I opened DFFS edit mode and cancelled out of it again and I got the attached error.
                  I have another list using the same dffs files. I opened it with the Console open, and did not receive any errors.

                  Attachments:
                  #10903
                  Alexander Bautz
                  Keymaster

                    In SP 2010 the variable “_spPageContextInfo” should already be present in the page, and adding the SP2007 code example to the page would not work (and might interfere with other features)

                    Does the list have the default forms, or has it been modified in SharePoint Designer? Do you see any errors in the dev console (hit F12 > Console)?

                    Try typing this in the dev console and hitting enter:

                    _spPageContextInfo

                    How does the output look like?

                    Alexander

                    #10881
                    Carl E Tippins
                    Participant

                      On our Dev site we have a list that was created when we were on SP 2007. The site has been updated to SP 2010. When I installed DFFS 4.365 I got an error message saying it looked like we were using SP 2007 and to add the List ID code to the DFFS_frontend_CEWP.html file.
                      I added the script — _spPageContextInfo={“pageListId”:”{64EFA99B-322A-49AD-AC5B-8B4F611F7969}”} — as indicated in the instructions, but the DFFS forms won’t load. (I had already updated the urls on the CEWP to the new links as indicated on the instructions.)
                      Short of rebuilding the list, is there anything else that can be done to fix the problem.

                      #10850
                      Alexander Bautz
                      Keymaster

                        Hi,
                        This is described in the DFFS change log: https://spjsblog.com/dffs/dffs-change-log/

                        Cascading dropdowns v3.527 (December 14, 2015)

                        Fixed a bug where the next dropdown was hidden if the query did not return any items despite the setting “Hide the dropdowns when they have no available options” being unchecked.
                        Added a check to flag “dirty” data where the string contains two or more consecutive spaces. Due to a bug(?) in Internet Explorer 8 (and possibly 9 and 10) that collapses these into one single space. This behavior causes the query for the next level to fail as the query specifies a single space value while the actual data stored in the db has multiple consecutive spaces.

                        This is a problem that is hard to fix in the script because SharePoint will strip these double whitespace out when returning the items from a query (look at the item in DispForm and you will see only one whitespace).

                        The cascading dropdown script will therefore not “see” the the double whitespace. When it then asks for matches to the next query, the result is no matching items because it has a single whitespace string in the query and the db has double (or more) whitespace in the string.

                        I’m afraid the only solution i know of is to “wash” the records in the lookup list.

                        You might find the affected items easier by using Google Chrome and search for ” ” (two whitespace characters) in a list view.

                        Alexander

                        #10824

                        In reply to: Hide button in ribbon

                        Alexander Bautz
                        Keymaster

                          I tested with this in the dev console:

                          $("#Ribbon\\.ListForm\\.Edit\\.Actions\\.AttachFile-Large").hide();

                          It will hide the button in my test (on office 365).

                          You might need to delay the execution of the code line until the ribbon has finished loading, but putting it in the custom js should do the trick.

                          Alexander

                          Alexander Bautz
                          Keymaster

                            Hi,
                            It looks like the code must be loaded with a slight delay to allow for the original comment count function to finish drawing the part we need to change. Try changing it like this:

                            <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
                            <script type="text/javascript">
                            function spjsCommentCount(){
                            	jQuery(".ms-comm-metalineItemSeparator").each(function(i,a){
                            		var b = _spPageContextInfo.webServerRelativeUrl+a.href.split(_spPageContextInfo.webAbsoluteUrl)[1].split("#")[0];
                            		$.ajax({
                            			type:"GET",
                            			url:_spPageContextInfo.webServerRelativeUrl+"/_api/web/lists/getByTitle('SPJS-CommentBox')/items?$filter=substringof('"+b+"',Title)",
                            			method: "GET",
                            			headers: {"Accept": "application/json; odata=verbose"},
                            			success:function(data){
                            				$(a).text(data.d.results.length+" Comments")
                            			},
                            			error:function(data){
                            			   //console.log(data);
                            			} 
                            		});
                            	});
                            }
                            _spBodyOnLoadFunctionNames.push("spjsCommentCount");
                            </script>

                            Please note that you should not load jQuery more than one time in a page. If you already have this laded – for example in the master page – skip the line form this code example.

                            Alexander

                            Jeff Law
                            Participant

                              Hi,
                              I was just wondering if there was any documentation on SPJS-Utility functions. I haven’t been able to find anything (I may need extra tuition on how to use search :-))

                              I have a requirement to add information from some other lists, which all share a common “ID” field, onto a new tab in the “master” list. There are currently 5 of these lists that I need to query, and display information from. Once displayed, then this info can be printed.

                              I have found reference to the spjs.utility.queryItems function which sounds like it will do all the heavy lifting for me, but I am not sure of the best way to drive it, so was looking for some reference, or an example.

                              Regards
                              Jeff

                              #10763
                              chgrnet
                              Participant

                                Some time ago you gave me some code that allowed me to hide custom action buttons in the ribbon. I am trying to make this work for hiding the “Attach File” icon in the ribbon. Will this code, when customized, work to hide this icon?

                                function hideAttachFile(){
                                spjs.$(“#\\{0293A6EF-6B2D-4C81-B992-69163627AB55\\}-Large”).hide();
                                }

                                Here is the info for the icon (not sure which one to use, if any):
                                Ribbon.ListForm.Edit.Actions-LargeLarge-0-0
                                Ribbon.ListForm.Edit.Actions.AttachFile-Large
                                Ribbon.ListForm.Edit.Actions

                                #10684
                                Alexander Bautz
                                Keymaster

                                  Hi,
                                  In editform you must use “spjs.utility.updateItem” like this:

                                  spjs.utility.updateItem({"listName":_spPageContextInfo.pageListId,"id":spjs.dffs.data.thisItemID,"data":{"Title":"New title value"}});

                                  Alexander

                                Viewing 15 results - 1,141 through 1,155 (of 1,358 total)