Tag Info

Hot answers tagged

14

Here is a post that shows how to do this. Link The following jQuery can be placed in a content editor webpart or on the masterpage, which is how I implemented it. function makeHeaderCollapsible() { $("div.menu-vertical>ul.root>li.static>ul.static").css("display", "none"); $("div.menu-vertical>ul.root>li.static>span.static").toggle ( ...


5

You certainly can; Rich's approach will work (and is probably the way I'd do it), you also have the option of porting the quick launch into an accordion control (there's a few plugins out there, or you can utilize jQuery UI). The nice thing about Rich's method is that it doesn't require re-rendering the quick launch--it's simply hiding or showing the ...


4

I'm sure there is room for improvement, but here is a working sample. jQuery(document).ready(function () { if(location.href.contains('&IsDlg=1')) { $(".ms-dialog td.ms-formbody > span > table > tbody > tr:first-child > td > span.ms-RadioText").each(function(){ //console.log('found the first ...


3

You can use the JSLink property to load multiple files. Include a url to the jQuery file and you have a nice workaround. Please note that you will have to use a url within the same web application, you can’t reference the library from a CDN or similar. Try something like this: $Field.JSLink="~sitecollection/Style ...


3

If the page the JSLink is on is not referencing jQuery and jQuery UI scripts, you will need to load them yourself. This can be done by for example: function loadScript(url, callback) { // adding the script tag to the head as suggested before var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); ...


3

Thanks for Tiago for providing the solution. So here is the code if you want to move description up for Multiple lines of text. $("td.ms-formbody > span > textarea.ms-long").each(function(){ var descriptionElement = $(this).closest('.ms-formbody').contents().filter(function(){ return this.nodeType != 1; }); var descriptionText = ...


2

Here is the script is working fine for me I found it from below link and did some modification. http://social.technet.microsoft.com/Forums/en-US/sharepoint2010customization/thread/02f1d451-aaca-4708-8171-fc6e4d24d7d6 $(document).ready(function() { // do stuff when DOM is ready $("#s4-leftpanel-content ...


2

Rather than using the _spBodyOnLoadFunctionNames function, go with jQuery's $(document).ready(). Also, in the Developer Tools in IE or Firebug, make sure that all of your files are loaded into the browser.


2

make HTTPRequest to entered url and parse received HTML for FAVICON url value if any; then use extracted favicon url to display associated image


2

Yes you can. This is done easily by adding the jQuery snippet to the first item the XSLT spews out only. In your ContentQueryMain.xslt find the template OuterTemplate.CallItemTemplate. It has a <xsl:choose> going on in it. In the <xsl:otherwise> clauss add the following: <xsl:apply-templates select="." mode="itemstyle"> ...


2

Ensure that the html element that the datetime control is in has the css property: position:relative; That ensures that the absolute positioning of the element inside it will be relative to its container.


2

Create a new calculated column in the list and enter the following formula: =[ColumnName1]&" "&[ColumnName2] I should add that you can use the calculated column to many things, please see this article for further use: Calculated Field Formulas Edited What you could do is to customize your listform in InfoPath. In this particular case you would ...


1

I ran into a similar scenario where I had to set specific authors, since you included a powershell code sample here is the powershell I used to make the changes. Be aware this goes through all posts and asks if you want to change the author on each one. It also changes the editor as well. Please take the time to read the script before using, and be sure to ...


1

You can read listitem properties from following code: function retrieveListItems(siteUrl) { var clientContext = new SP.ClientContext(siteUrl); var oList = clientContext.get_web().get_lists().getByTitle('Announcements'); var camlQuery = new SP.CamlQuery(); camlQuery.set_viewXml( ...


1

You can bind a click event to an image using jQuery in the same way as you would with any other element (though this really isn't a SharePoint question): jQuery('yourselector').click(function() { console.log('Image clicked.'); }); If you're trying to read and compare list data, you should read up on SharePoint's JavaScript Client Side Object Model.


1

This is a broad question and there are multiple ways to approach it. First, you need to decide where to get the "associated information". If it's just a couple fields, you could consider loading it within the data view. If it is a bigger chunk (e.g. includes images), then you'll load it on demand with an AJAX call when the user selects an item. [Edit] ...


1

Found the solution. All it took was replacing this bit of code: var h3 = '<h3>' + oListItem.get_item('Title') + '</h3>'; var div = '<div>' + oListItem.get_item('Floor') + '</div>'; var content = $(h3 + div); content.appendTo("#accordion").show(); with this bit of code var newDiv = "<h3> " ...


1

Have you thought about adding code to detect the crawler and "unfurl" the accordion? For example you could look at the User Agent that is passed by the crawler.


1

If you really need to send the result of the modal dialog to the server side code of the calling page then you can use Client-Callback see Client-Callback Implementation (C#) Example and put the javascript call of the server callback in the CloseCallback. There is no need for your server side btn_Click as this happens when the button is clicked and should ...


1

You are calling your javascript files incorrectly. Please refer to my post here (Relevant quoted below): How to add jQuery script to a custom visual webpart? Here is some example code I used in a control for SOD, in a visual web-part it should be the same. // Running in a Control added to Master Page // Register the JavaScript file to the header ...


1

If found out that Internet Explorer handles autocomplete focus event differently that other browsers; essentially IE performs the event asynchronously, and because of this I was unable to quickly determine the event order from which the events were firing. Basically, all I had to do was add this little bit of code to the select event: select: ...


1

Load jQuery using a ScriptLink control: <asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server"> <SharePoint:ScriptLink ID="ScriptLink1" Name="Emailjs/1.7.2.jquery.min.js" Localizable="false" LoadAfterUI="false" runat="server" /> <script type="text/javascript"> ...


1

You can try putting wait mechanism for loading of the jquery file before execution of the script. Use following method ExecuteOrDelayUntilScriptLoaded(setAttributes, "your_js_filename.js"); in .js file to wait till all the files are loaded and see. Hope this helps!


1

Finally worked it out, turns out the Masterpage that SP2013 created from my HTML page did NOT include the required JS files for modal popups to work. I had to edit the HTML file in SPD2013 and add the following code. <!--MS:<SharePoint:ScriptLink ID="ScriptLink2" Name="SP.js" runat="server" OnDemand="false" LoadAfterUI="true" ...


1

there is a bug in jquery.ui.datepicker.js ..did the following to eliminate the weird scroll up behaviour. change: Line 1498: '" href="#">' + printDate.getDate() + '</a>')) + '</td>'; // display selectable date to: Line 1498: '" href="javascript:;">' + printDate.getDate() + '</a>')) + '</td>'; // display selectable date ...


1

If SPServices SPCascadingDropdown will not work (I don't remember: it may require the columns to be of type Lookup) then my suggestion is to either fork it and modify it to do the cascading on regular (non-Lookup) fields or take a look at Marks code for that utility and roll your own. The approach would be for you to replace the text fields on the form with ...


1

You should check if js library is already on page if it is - don't add it second time if it is not on page - load it.


1

When creating the column, expand the "Column Validation" section and you should see a text box where you can enter a formula. To test if the first character of a column called "ToValidate" is I or F use: =OR(LEFT(ToValidate,1)="I",LEFT(ToValidate,1)="F") The syntax is basically Excel so you might want to test any other formulas in that first.


1

=OR(ISNUMBER(FIND("F";Title));ISNUMBER(FIND("I";Title))), Title - your field


1

In theory yes, if you can get the CQWP to output the required HTML for the jquery libraries to operate properly. If you can't, then you'll have to write something from scratch to do it.



Only top voted, non community-wiki answers of a minimum length are eligible