Tag Info

New answers tagged

0

I'm not sure how your code is working - unless you have a very customized version of the Master page... In SharePoint >= 2010, the "body" of the page (area below the ribbon that has a scroll bar) is actually a <div> with an id of s4-workspace... Try this: $("#s4-workspace").animate({scrollTop: $('#WebPartWPQ1').offset().top}, 1000); The above code ...


0

It's really not an SPServices thing, per se, but a JavaScript/jQuery thing. Many functions give you callback values, and xData and Status are just examples of that. As Eric says, you can use any name you like, but most people seem to stick with xData and Status, as that's what I use in all of the examples. (I borrowed those names from somewhere else back in ...


0

If you are using _spPageContextInfo.userId, what are you using to get your other User values? You can make a REST call to https://{your site}/_api/GetUserById({id}) to grab the values. The alias should be a Title value?


1

You can always scrape it from the DOM if you need to. The exact code will depend on what version of SharePoint you are running. Open your favorite browser's developer tools, and search the DOM for your name. In this example, I'm using an Office 365 site: In this case my name is in a div with the ID of SuiteNavUserName, so the code would be... ...


3

xData represents the returned data, it could be replaced with foo or blah or whatever you'd like. Status represents the status of operation, off hand I don't remember if it is the status code (like 200) or status text (like success). I rarely use status and rely on the xdata returned in doing logic checking.


1

I've never seen a plugin however; its not too difficult to do this on your own. There is a JavaScript function in SharePoint called "PreSaveAction" that is fired just before the item is validated and saved. You can use this function to call your function. For example: function PreSaveAction(){ var itemTitle = $("input[title='GUID']").val(); if ...


1

If you just need to access the values, you could do it like this: var dispTitle = "APickerField"; var pickerDiv = $("[id$='ClientPeoplePicker'][title='" + dispTitle + "']"); var peoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[pickerDiv[0].id]; peoplePicker.GetAllUserInfo(); The GetAllUserInfo() returns an array with one index pr ...


-1

Found this article quite useful for scrolling text, check out http://sharepointlogics.com/2014/07/sharepoint-scrolling-announcement-news.html


1

I too think this is an out of order script loading. Although: this is the first time I'm hearing about jQuery interfering with core.js and others. Because CEWP are inserted into the Body other page - thus after the HEAD script files - is what makes doubt this is a timing issue. SP (2013... And maybe 2010 too) uses a global variable called $, so maybe ...


0

you are trying to add multiple scripts to a loading page, which will conflict with other scripts. my advice is to add them to the master page, or if you want to use them in a single page, at least add them to the PlaceHolderAdditionalPageHead of the current page, which is sequentially after core.js if you insist in having them in the CEWP, try defer


1

There is no "root" site collection in SharePoint, just a site collection at the main domain address. It's not any more important or noteworthy than any other site collection. Either load it from an absolute url at that site, store it on the hive or load it from a third party CDN (https://developers.google.com/speed/libraries/devguide#jquery)


1

You should be able to change the reference URL to something more specific, like the full URL of the site collection, or your CDN, like name="https://mydomain/sites/here/jquery.js"


0

I wouldn't say disable, but it can block it from being loaded properly. If there occur syntax errors and such in one or more files then yes, it could potentially "disable" core.js - but it depends on the version of SharePoint (2010 or 2013?) First I would suggest that you check the console log in IE using the WebDeveloper tool (F12) to see if any ...


0

Interesting - the 2013 behavior uses a function in the blur event of the search box to populate or hide the term 'Search...' as appropriate -- I'm guessing to support old IE versions instead of using the placeholder property... So! What you need is: //use this instead of immediate or jQuery ready because we want to manipulate SP generated markup ...


2

I do remember having a similar problem to this in the past. The SP.js never loaded on Published pages. Because it's not loaded, the file is not able to call SP.SOD.notifyScriptLoadedAndExecuteWaitingJobs and hence the call to ExecuteOrDelayUntilScriptLoaded will never run. In order to load the file from the SOD library, use the following: ...


0

That action will need to be adjusted on asset portal browser page itself. The OK button commits differently than the cancel button does. What I would do personally is set up a JScript function on load in that page to look for a URL param. If that param equals..let's say 1 ... Look for the OK button on that page and change the on click function to the same as ...


0

Try removing the jquery document ready function and place the execute or delay directly in the script tag. I thing the issue here is the order in which your functions fire...


2

The dataview web part is executed server side, so you can't use jQuery to manipulate the SelectCommand. You would need to remove rows from the DOM with jQuery after the web part has loaded. I would use jQuery to hide the web part initially. Then, make your SPServices call to get the user's Office. Then iterate over each row of the table and if the Office ...


1

I have a list MyTestList. It has currently two views TestView1 and TestView2. To add serial number in the front follow the following steps: Open the site in SPD Open the List Edit the view in Split mode Select the List, Go to 'List View Tools' in the Ribbon > 'Design' > 'Customize XSLT' > 'Customize Entire View' This will convert the view in detail xslt ...


1

You can use SPD. On a page add the list view, then create a column and insert the following code: <xsl:value-of select="count($thisNode/../*[not($thisNode/@ID=preceding-sibling::*/@ID)])" /> It should render the row number, no matter if you change the view order or filter some information. Hope this helps


2

It seems that you would want to upload an excel document to a document library and while that happens, do stuff. One way to achieve this is creating an event receiver that captures the ItemUpdated event. For the "do stuff" part, you can use the openxml api, which will allow you do read data from the excel document and populate it in the list. here are a ...


0

If you want to use the SharePoint javascript model so that the popup look and feel will be the same as the OOTB popups, you will need to use the SP.UI.ModalDialog.showModalDialog(options) from the SP.UI namespace. As you can see from the linked page, you can use the "html" option parameter to specify a dom element to display in the popup (ignore where ...


2

You have to use JQuery Plugin. Wrap your panel elements inside a single div and create a close button for popup for example <div id='popup-wrapper'> <asp:panel.... All Text Boxes /> <a id="close-btn" href="#">Close</a> </div> Add following references to your page <script type="text/javascript" ...


0

How about wrapping your script in an Edit Mode check? Then the lists will be expanded while editing. var editMode = document.forms[MSOWebPartPageFormName].MSOLayout_InDesignMode.value; if (editMode != '1') { $(document).ready(function(){ $(".category-qms-expand").click(function(){ var id = $(this).attr("id"); var name = ...


1

I just found the answer myself here: http://blog.pathtosharepoint.com/2008/10/25/expandcollapse-buttons-for-your-web-parts/ Worked perfectly. Allows open and close of CEWP with one click, and you can still edit their content in the wysiwyg editor.


0

Maybe the question needed to be more clear. I could not find certain fields while using jquery ajax to call the lists.asmx and call GetListItems. Apparently, by default, the call fetches fields that are present in the default view of the list. To answer the question: Simply add the fields needed to the default view (AllItems.aspx, in most cases) of the ...


1

One of the ways to achieve the same result is to use knockout.js. You can use knockout.js and populate the data using a foreach loop in a observable array. And in the Web-Part you need to map the knockout data member. This is good because you will use object oriented JavaScript and MVVM. And code will be little less. Please check the following code: ...


0

Sorry I can't post code right now, but if you are still having a problem next week, I'll post back. I created a plugin awhile back to do this: make elements sticky. It supports sharepoint and I'm currently using it in SP2013 (o365) with a few small apps. The plugin is: http://purtuga.github.io/jquery.stickOnScroll/ You will need to use the set the ...


1

The relationship between .html and .master is a bridge. It has been implemented so that developers who are not familiar with ASP.NET masterpages and SharePoint can use the .html file to do the changes in a "environment" they are more or less familiar with. I'm going to assume this is an on-premise solution, so yes, downloading and putting the .js file in ...


0

If you want to remain within the OOB features, you can set a script that limits the size of the promoted links frame. It automatically sets 160px + space, but if you set it to a smaller size, it will automatically wrap the tiles on the new row. In this example .ms-promlink-body {width:900px} the sixth tile will be in the new row. cheers


0

I use this with IE, FF, and Chrome. You need to add the headers object to your $.ajax() request: $.ajax({ url: "http://sharepointsiteurl/_vti_bin/lists.asmx", type: "POST", dataType: "xml", data: soapEnv, headers: { "SOAPAction": "http://schemas.microsoft.com/sharepoint/soap/GetListItems", "Content-Type": "text/xml; ...


0

Great thanks to Aveenav for partially helping me along. The answer was relatively simple. I used Aveenav's idea of pulling the value from the URL and storing it in a variable but I then used this variable to show the hidden field instead of trying to parse the value into the dropdown and getting the dropdown value to do the work. So I tweaked my code like ...



Top 50 recent answers are included