Tag Info

New answers tagged

2

Ok, here's what's happening: // select ALL elements that are .block .title h2 span and loop through them $(".block .title h2 span").each(function(index) { // find the length of the text of THIS PARTICULAR element var x=$(this).text().length; // if the length of THIS PARTICULAR element is > 29 if(x > 29) { // change the ...


2

You can create your own file control in HTML and hook it up with the below script. I use an asynchronous loop to iterate through the files. //Enable Multiple Upload Script $('.attachmentButton').change(function(event){ //alert("change"); //startUpload(self, function (){ reloadPage(); }, event); $("#WSOutput").html("<b>Please wait while ...


1

For clarity, this is how I addressed the problem above. Wrapping the function calls in a function that explicitly waits until the client context is loaded helped to delay the AJAX calls long enough to make sure that they all were executed successfully. No need to use async:false in the AJAX. //writes CSS classes to body script based on explicitly checked ...


0

see if you can use 'async : false' in your ajax call and verify the logs to validate that the function is being called for all the 8 users.


1

After some more analysis, I resolved the code above. Looks like the conversion from SP2010 to SP2013 changed the value the javascript was looking for in the dropDownList. var theSelect = getTagFromIdentifierAndTitle("select","Lookup",fieldName); I changed the Lookup to LookupField and the JavaScript above started working again.


0

Above code wont work properly if you click on submenus.working code is below <script type="text/javascript"> $(function () { /*set dynamic css logic*/ if ($('#sideNavBox .menu-item.selected').length) { //propagates the selected class, up the three. $('li.static').removeClass('selected'); ...


0

Here is the code I used (not optimal but working). It uses the SPServices library, you should include that before this script. Note the "async: false;", this ensures the load script finishes before slidorion inits. <script type="text/javascript"> $(document).ready(function(){ /* gather content */ $().SPServices({ operation: ...


0

This is less a "SharePoint thing" and more a "JavaScript thing". If you have the counts, you can poke them into the DOM wherever you want them. All those counters are are divs or spans or lis that contain the numbers. So if you design the markup you want and style it the way you want, then you can drop the numbers into the containers with your script.


0

You must await jQuery too: <script type="text/javascript"> _spBodyOnLoadFunctionNames.push("myCustomFunctionName"); function myCustomFunctionName() { jQuery(function(){ $('#slidorion').slidorion({ speed: 1000, interval: 4000, effect: 'slideLeft' }); ...


0

I am not sure what 'users open tasks' refers to but to use jquery ,any other library and css you could create a custom webpart for sharepoint or a sharepoint app with an apppart if using 2013, this allows you to leverage all CSS,HTML and any libraries you need with use of the sharepoint JSOM. Basic operations using JavaScript library code


0

You have the minimal download strategy feature enabled, this is what generates /_layouts/15/start.aspx#/, simply deactivate this site feature. This should then allow your JavaScript code to execute more reliably. As for your home page, click the Page tab in the ribbon of your desired home page and click Make Homepage.


0

For filtering you are missing a $ in your URL: var url = SiteURL+"_vti_bin/listdata.svc/"+currentList+"?$filter=Id eq '"+refID + "'"; But, to get item by ID with ListData.svc you should provide an URL like this: http://thesiteUrl/_vti_bin/listdata.svc/listName(1) Where listName is the name of the list, and 1 is the ID of the item to retrieve, so in ...


0

Looks like there were some subsites with unique permissions. I added the security trimming filter at the end of the call and it fixed the issue. /_api/web/webs/?$filter=effectivebasepermissions/high%20gt%2032 Thanks for your help


0

You can use JSLink which comes with every SharePoint List. This enables you to render content using your own code. Try this post for a complete guide on JSLink and this for grouping content. Hope this helps you to start in the right direction.


3

You can use below mention CSS to fix the height of all multi line textbox whether it is in list view or in quick edit view. .ms-rtestate-field { max-height: 100px; overflow: auto; width: 250px; word-wrap: break-word; } Change the height & width as per your needs. Apply this CSS in SharePoint master page if you want to to work for all ...


0

Try giving the multi line textbox a fixed height. It will automatically add a vertical scrollbar.


0

Dropdown lookupcoloumn in sharepoint forms may have some issue like this here is the way that I solved it: var choices = $('[title="Title"]').attr("choices"); var choiceArray = choices.split("|"); for(var i=0;i<choiceArray.length;i++){ if(choiceArray[i]==291){ // 291 is the LookupId of that LookupValue console.log(choiceArray[i-1]); // The ...


0

Scroll Bars for Multiline Text Box in SharePoint Use the below Image Code


1

For Relative Path in sharepoint you can use any of the two: var url = window.location.protocol + "//" + window.location.host + _spPageContextInfo.siteServerRelativeUrl; Or we can use var context = new SP.ClientContext(); var relativeWebUrl = context.get_url(); var fullWebUrl = window.location.protocol + '//' + window.location.host + relativeWebUrl ;


0

I have resolved this issue and implement successfully. https://codeplayandlearn.wordpress.com/2015/07/07/bind-colorpicker-control-to-the-sharepoint-list-field-using-jslink/


0

@Dipen If your field internal name is text_colorpicker then you can get the textbox by the following $('[title="text_colorpicker"]')


0

You will find textbox of any field by internal name of column in list. Like if your internal name of column is like 'text_colorpicker' then textbox will be generate with id = "text_colorpicker" in NewForm.aspx which is sharepoint's inbuilt functionality.. Then you can easily access that textbox i.e. $('[id$="text_colorpicker"]') But if you have applied ...


0

Have you tried just re-opening the working in SharePoint Designer and re-publishing it? SharePoint 2013 supports starting a workflow from CSOM, however those are 2013 workflows. If you wanted to do that, you need to create a 2013 workflow that will call your 2010 workflow using the interop activities. Look at this SPSO question here on the syntax for ...


0

FYI, If you are only after using (simple) jQuery selectors. Microsoft has this thing called mQuery built in SharePoint. So jQuerys: $('#myID') becomes: m$('myID') straight out of the box, without the need for jQuery It is loaded on most pages (check in F12 developer tools) if not, use: EnsureScriptFunc('mQuery.js', 'm$', function() { // DO STUFF ...


0

Try referencing with this so your listItem inside the methode is always the same: function createListItem() { var clientContext = new SP.ClientContext(siteUrl); var oList = clientContext.get_web().get_lists().getByTitle('Announcements'); var itemCreateInfo = new SP.ListItemCreationInformation(); this.oListItem = ...


2

Please write below mention code outside the For-loop & try it. var ctx = new SP.ClientContext(appweburl); var appCtxSite = new SP.AppContextSite(ctx, hostweburl); var web = appCtxSite.get_web(); //Get the Site var list = web.get_lists().getByTitle("wbslist"); var listCreationInformation = new SP.ListItemCreationInformation(); var oListItem11 = ...


0

When a field is set to required, then Required Field text is added to the title of the field. So, do something like this: function PreSaveAction(){ if($('input[title="FieldName Required Field"]').val() == ''){ alert('Please enter some value'); return false; }else{ return true; } }


1

You can also add your scripts in the following section too. <SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true"/>


2

In your custom page layout first add path to .js file (put path to src="") and then code. <script src="jquery-1.8.3.min.js">//<![CDATA[ //]]> </script> <script>//<![CDATA[ $(document).ready(function(){ //some code }); //]]> </script> <!--MS:<Publishing:EditModePanel ...


0

I was able to get it working. I found the SP.JS file in the Layout folder of Sharepoint. With this I was able to Google about Sharepoint s REST API with OData at https://msdn.microsoft.com/en-us/library/office/fp142385.aspx and about OData Query parameters at http://www.odata.org/documentation/odata-version-2-0/uri-conventions/#SelectSystemQueryOption . This ...


5

I guess you could always use a site collection token in your URL. ~sitecollection URLs and tokens in SharePoint 2013 If that don't work out for you, this blog post has a lot of great examples when working with masterpages and references. Use Site Url in SharePoint Update Try using a scriptlink instead. I'm unsure if encoding is needed thought. Try to ...


0

The following example demonstrates to update SP.FieldChoice field properties: Referred from SHAREPOINT 2013: How can I read Site column contents and modify them via javascript csom function updateFieldChoice(fieldTitle,choiceValues,success,failure) { var ctx = SP.ClientContext.get_current(); var web = ctx.get_web(); var fieldChoice = ...


0

Found a solution myself: Made the field a Lookup field and added the entries the following way: <option value="ItemId">ItemTitle</option> Works perfectly.


0

Correct me if I'm wrong so I can update my answer but it sounds like you're just trying to change the landing page for a specific team site to be Home.aspx? There's two ways to approach this. Firstly, if you have publishing features enabled (documentation) then you can change the welcome page under Site Settings -> Look and Feel If not then you will ...


0

You got the Minimal Download Strategy feature activated, that's what "ruining" your URL, and it's also why the page Title and the menu is still showing. Head to Site Settings > Site Features and deactivate Minimal Download Strategy. And you could hide the elements using CSS instead. <style type="text/css"> #sideNavBox { display: none; } ...


0

You need to disable the Minimal Download Strategy feature for the script to work right.


0

If you're jQuery file is in a document library, ensure that Team Site Visitors have atleast Read permissions for that document library and also ensure that the jQuery file is checked-in and published (if needed).


0

I see you are using an on-prem version, so I suggest using out-of-the-box ways of achieving this. In the masterpage there should already exist tools to help you achieve this. In SharePoint 2010 (I haven't fooled around with Masterpages in 2013 a lot) the way to solve what you are asking for was to do this: <div name="onetidProjectPropertyTitle"> ...


3

Mark, See if this can help you. If you are writing the custom code this can set you the starting point.



Top 50 recent answers are included