Tag Info

New answers tagged

0

Since this is custom code SharePoint's OOTB audience functionality does not apply for this. You'll have to implement a similar logic into your custom code. In the code-behind it is possible to check current users permissions and use that to prevent the user from seeing specific elements. For this to work properly you'll have to include something in your DB ...


0

I shouldn't be using UpdatePanel, as it posts back to the same page, and the replies are likely in the page-load event, hence are getting reloaded along with my label. Instead I should be using something like this: <SharePoint:ScriptLink ID="scriptlink" Name="SP.js" runat="server" OnDemand="true" Localizable="false" /> <script ...


2

Just wrap your code inside the uploadMyFile function into ExecuteOrDelayUntilScriptLoaded, as shown below: <script type="text/javascript"> $(document).ready(function() { $("#some-a-element").click(function uploadMyFile(directory)) { ExecuteOrDelayUntilScriptLoaded(function() { // something ...


3

The error may be throws because core.js loaded before init.js (because FV4UI function is part of init.js file). Also, check this post. <!-- the following 5 js files are required to use CSOM --> <script src="/_layouts/1033/init.js"></script> <script src="/_layouts/MicrosoftAjax.js"></script> <script ...


0

It is not good practice for many reasons to modify out-of-the-box SharePoint files, the most obvious being that this type of customization is officially unsupported. For details please follow, for example this article. In your scenario there are at least 2 ways how to provide additional client side functionality for Alert dialog: Override NewItem2 ...


0

I have exactly the same system's behavior when page didn't exist with such URL (i thought it was, but actually it wasn't - usually, the simplest mistakes is harder to find). I always start checking URL first now - hopefully, it helps someone.


0

I got it, you need to use this method .get_lookupValue().


0

You need to call the right field... function findItems() { var soapEnv = "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> <soap:Body>" + "<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>" + "<listName>listNameHere</listName>" + ...


0

It may not be a pretty solution, but I did find a way to retrieve the list item ID. The first thing I had to do was pull an identifing column for that row. I was able to do this with the "Title" column, which is unique per user. var taskDesc= $($(this).closest('tr').children(":first")).eq(0).text(); completeSelectedTask(taskDesc); I then used CAML and ...


0

If I'm not wrong you can find this function into C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS{LCID} folder. There is the init.js and init.debug.js. Of course, you will have these files for each language that is installed to your environment. But I do not recommend you to make changes in these files, because these ...


0

Here is a link to a same question. Taken from the link: In the handler: var id = $(this).closest('tr')[0].id; or var id = $(this).closest('tr').attr('id'); or if by "id" you meant its index, do this: var id = $(this).closest('tr')[0].rowIndex; Also try: var id = obj.parentElement.nextSibling.innerText;


2

Here is some js that should load efter the ribbon is loaded: SP.SOD.executeOrDelayUntilScriptLoaded(function() { // Your code here }, "sp.ribbon.js"); More about modifying in this blogpost Edit: // Fires ‘ribbontabselected’ after the ribbon has been initialized after load ExecuteOrDelayUntilScriptLoaded(function () { var pm = ...


3

This topic came up recently on the SPServices forum where some level of success was claimed. A bounty was even payed. Check this link out: http://spservices.codeplex.com/discussions/354399 Paul


1

Good way to remove handlers from dialog's close button is using $clearHandlers Method. Check code below: function fValidateBeforeClose(event) { var isValid = true; //set IsValid value if(isValid) { //close dialog SP.UI.ModalDialog.get_childDialog().close(); } else { alert('Not valid'); } } function ...


1

I think you should remove old event handler var js = oCloseButton.attr("onclick"); oCloseButton.attr("onclick", "");//remove sharepoint click handler...


3

If you are talking about the button on the top (X). The controls up there are part of the parent window iirc. So try changing it to: var closeButton = jQuery("a[id^='DlgClose']",parent.document);


0

I think that you need to use SP.Web.ensureUser method to retrieve user by it's logon name, after this you can use SP.User.email property. SP.SOD.executeFunc('sp.js', 'SP.ClientContext', sharePointReady); function sharePointReady() { //retrieve logonName var clientContext = SP.ClientContext.get_current(); var web = context.get_web(); var ...


1

To work with the SharePoint JS library you must have the SP.js at least: <script type="text/javascript" src="/_layouts/SP.js"></script> <script type="text/javascript" src="/_layouts/SP.UI.Dialog.js"></script> <script type="text/javascript" src="/_layouts/SP.Core.js"></script>


0

Yes, add one of these to your URL depending on which tab you want viewed: &InitialTabID=Ribbon.List &InitialTabID=Ribbon.ListItem // the item tab &InitialTabID=Ribbon.Read // this is the browse tab, no ribbon.


1

In my case I needed to know the language before the SharePoint javascript libraries are loaded in order to hide elements before they are shown on the screen (not possible with _spBodyOnLoadFunctionNames). Turns out SharePoint sets the lang attribute of the root HTML element according to the language and as a bonus it's already translated to the "en-us" ...


1

This works, but I need to be able to construct the user object from the currently logged on user. Shouldn't be too difficult I hope ! var users = new Array(1); var user = new Object(); user.AutoFillDisplayText = "Ian Chivers"; user.AutoFillKey = "i:0#.f|membership|ian@kwsservices.onmicrosoft.com"; user.AutoFillSubDisplayText = ""; user.AutoFillTitleText = ...


0

This blogpost describes how to get the current users manager by using the SPservices library. The SPServices libary can be found on codeplex.


0

I was looking in the wrong place. Instead of being in the ribbon bar, it's in the settings icon in the right -> "Edit Page". This seems to do what I want.


2

Does it help if you set the ContentType parameter of your post like: $.ajax({ url: _spPageContextInfo.webServerRelativeUrl + "/_api/web/lists/getByTitle('Eleves')/items", type: "POST", contentType : "application/json;odata=verbose", data: JSON.stringify( { ...


3

The problem is likely because you are using jQuery 2.0 which does not have support for IE 6/7/8 or IE 9/10 when running in compatibility mode (which I'm guessing SP 2010 is using. You can confirm this by using the F12 developer tools). I would recommend using jQuery 1.9.1 for use with SharePoint and so you still have support for the older browsers.


0

can you please try This link . Please update if working as I am also facing same challenge. My developement: using VS 2010 add ribbon button as a feature and call Javascript. refer This Link Thanks.


0

Ensure that you have completed the following steps. Once completed, the default functionality should be open as opposed to the check-out / open dialog. Go to http://www.adobe.com/misc/linking.html Download PDF small icon (17 x 17) Save it to your 14 root template images folder (typically located here: C:\Program Files\Common Files\Microsoft Shared\Web ...


1

have you found the solution? I am also facing the same challenge. Thanks. Update: I am facing same problem but I am able to print. Please refer This Link Hope this link will help others too. Please let me know if you can explore more. Thanks.


0

You can actually load debug versions for js files and see exactly where it crashes. To do this, got to app pool web config, typically to C:\inetpub\wwwroot\wss\VirtualDirectories\80\web.config and set compilation : debug=true <compilation batch="false" debug="true"> I had a similar issue and it was fixed after a windows update.


-1

var itemCollection = {}; itemCollection is an empty object on the error line. Just give some thoughts, havn't try the code, would pass it as pamramater work? clientContext.executeQueryAsync(function(sender, args){ onListRetrieveSuccess(itemCollection); }, onSPQueryFailure); remove the global object (itemCollection), will this work? ...


0

Using the ID will not work as is changing all the time, I'd use instead the name of the Category and in your case get find the related status and match category names. In my case I'm sending the name of the category in the URL to expand a category : (You can edit the page View or add a content editor web part) function getParameterByName( name,href ) { ...


0

Change ExecuteOrDelayUntilScriptLoaded(start, "sp.js"); with SP.SOD.executeOrDelayUntilScriptLoaded(start, "sp.js"); Reference: http://msdn.microsoft.com/en-us/library/ff411788(v=office.14).aspx


0

I don't know, but maybe Powershell could help you. Have a look at this post: http://www.c-sharpcorner.com/uploadfile/anavijai/modify-user-profile-properties-in-sharepoint-2010-using-powershell/ He stores the changes in a xml file and pushes everything up with Powershell: function ModifyUserProfileProperties() { $site = Get-SPSite ...


2

The webTemplate property is not exposed by the SP.js in 2010. (It is however in 2013: http://msdn.microsoft.com/en-us/library/jj838541.aspx). However, there is a JS variable written to the page with the web template name: g_wsaSiteTemplateId. Without any server-side code, etc., that would be the only identifying mark of the template.


0

There are at least 3 types of selection based columns: 1. Choice lists (single value and multi-value) 2. Lookup lists 3. Managed Metadata 4. Custom multi-valued columns - most complex - won't fit really as it is too complex. There is a difference in how you would need to read/store these values. For example for Lookup you would use SP.FieldLookupValue which ...


0

Use SharePoint Designer. In it, you can do all of the logic you describe. You have the ability to check the value of a column (whenever its value is changed/set by someone, for example), and depending on that value send an email to whomever you like. You can also dynamically send emails based on a Person column, so if you want to send an email to whoever ...


1

My problem solved - Upon examining the DispForm.aspx page in SharePoint Designer, as I have mentioned before, the content of the Multiple Lines Rich Text type column is displayed using the XSLT code - <xsl:value-of select="@Progress_x0020_Comments"/> The solution is to include the attribute "disable-output-escaping" and set it to "yes" So the ...


0

I just wrote a blog entry on how to do this on the server-side. Put the class ThemeHelper into your apps, and then generate your CSS on the server-side, placing theme colors into the CSS where necessary. http://go.limeleap.com/community/bid/287707/How-to-Easily-Bring-SharePoint-2013-Theme-Colors-Into-Your-Apps Hope this helps!


0

You could use jquery to select the tag that you want by the class/id/type of that and change the CSS by the css jquery property. For example: $("div").click(function () { var html = ["The clicked div has the following styles:"]; var styleProps = $(this).css( ["width", "height", "color", "background-color"] ); $.each( styleProps, function( prop, value ...


0

Avoid manipulating a page via scripts loaded with CEWPs. It's messy and insecure and can be broken easily by any user with edit access to the page. Load those scripts in the master page or the page layout, if you need them. And yes, you can make the text box wider with CSS, but you won't be able to convert it to a multi-line text field. That's another data ...


0

If you are adding script to a page then its safe to add the script through Content Editor web part (you can find it in Media and Content folder when you click insert web part). There you can edit the web part and click "Format Text" on the ribbon menu then click "Edit HTML source" in Markup group of the ribbon. Add your code there and save it. Sometimes ...


0

Yeah, you're on the right path. Use a CEWP, and if you can grab the control, you should be all set to apply css to resize it as needed. Here's a little cheat I use. These functions return the TD cells from the table. Using getFieldCcontrolCell("Field Name"), you can then search it for the textbox and work it from there. function ...


0

This is other custom field SharePoint Cascaded Lookup


0

Both of the above answers are true, but incomplete because there are times where your code could be loaded twice, so what you really want to do is implement SharePoint lazy loading of scripts with Scripts On Demand. Lazy loading of scripts also significantly improves page performance. For this you register your script with scripts on demand: ...


1

please refer to this answer that i answered about the minimal download stratergy ;) External access gives a blank home page to stop it do the following: go to: Site settings > under Site Actions section > manage site feature now disable the feature MDSFeature and it will keep on that link instead of redirecting ;)


0

If you do not want to use jQuery you can use _spBodyOnLoadFunctionNames, but be careful if you use this method you should keep in mind that you need to use ClientId to be sure that your function is unique on the page, because this method does not check how many times do you push your function and can call it several times. Also will be nice to use ClientId ...


0

My suggestion is use jQuery and create your table only when the document it ready: $(document).ready(function () { ... });


3

I did something like this for a client. My solution was made a web service. By this web service I was able to make an AJAX call and create an Alert code behind.


3

There is no built in way via the SharePoint JavaScript Object Model according to my research. Likely you will have to build your JavaScript to work with the SharePoint 2010 Alerts Web Service: http://msdn.microsoft.com/en-us/library/websvcalerts(v=office.14).aspx using JQuery or whatever framework calls from JavaScript on your page.


0

Set the customConfiguration.DefaultTokenLifetime = new System.TimeSpan(8, 0, 0); Refer the link : http://blogs.perficient.com/microsoft/2010/12/sliding-sessions-with-sharepoint-2010-and-claims/



Top 50 recent answers are included