Tag Info

New answers tagged

0

I wonder if SharePoint's default client side rendering could be taking effect and rendering over your changes after you have applied them ? At a minimum it might make a difference if your CEWP is above or below the listview web part ? Also do you need to call jQuery(document).ready() ? eg. (I have not tested this...) <script type="text/javascript" ...


0

I have modified the function and split it into 3 functions. I have not tested this code, but based on my past similar experience this can be the solution. 1. Create a table structure with tr inside it. //Create a table structure with rows having id = version id of an item function createVersionTable() { var tr = []; for (var i = 0; i < ...


0

Try below. I have used the $.when(Deferred).done(whatever here); function YourFunctionName(){ var tblBody = ''; var Callback = function(){ for (var i = 0; i < xArr.length; i++) { tblBody += "<tr>"; var xDiv = $("<div>"); xDiv.load(xAppWebUrl +"/Lists/dlWerkinstructies/Forms/DispForm.aspx?ID=" + xItemId + ...


0

You could use SP.ListItem.fieldValuesAsHtml property to get the values for the list item as HTML, for example: ctx.load(items,'Include(FieldValuesAsHtml)'); //retrieve FieldValuesAsHtml property ctx.executeQueryAsync( function() { for(var i = 0; i < items.get_count();i++){ var item = items.get_item(i); var statusText = ...


1

As far as I see, the value of the _ModerationStatus is stored as numbers, corresponding the values in the SPModerationStatusType enumeration. You can translate the numerical values by defining your own moderationStatusType array in JavaScript as shown below: var moderationStatusType = [ "Approved", "Denied", "Pending", "Draft", "Scheduled" ]; var ...


1

You can use ToolTipTitle and  ToolTipDescription of the Button element in custom action.


2

I don't think you use the correct columns' names. You're using the names as seen by the SharePoint search engine, not the internal names of the fields. For instance, ows_Title should be Title, etc. On the other side, I don't think the nested OR are wrong here, they're just up-side-down.


2

The whole Or section looks wrong, try using BIWUG CAML Designer to craft your query, then use that in your SPServices function. Also, you need to use the internal field names, not the web service returned fields (Description1 vs ows_Description1 etc). http://www.biwug.be/resources Typical nested Ors would look like this: <Where> <Or> ...


2

Yes you need to place following query option CAMLQueryOptions: "<QueryOptions><ViewAttributes Scope="Recursive"/></QueryOptions>"


1

Yes this is possible. I have successfully used the the onvaluesetfrompicker function of a Date field, like so: $('#specificDateFieldID').get(0).onvaluesetfrompicker = DatePickerChanged; function DatePickerChanged() { // Do stuff } But this was in SharePoint 2013. It seems from this that it should also work in SharePoint 2010 with custom forms, but ...


0

There is no straight forward way to do this. The reason being when you click the calendar icon. It open the calendar control in an IFRAME. It is not possible to attach any event to elements inside the iframe. And thus we can't capture date click event. When we click on a date, there is a JavaScript running behind the scene which will update the INPUT ...


0

You can make use of QueryString. So in each link you can format it like http://siteurl/whateverpage.aspx?ItemId=14 Change 14 and dynamically place the Id. Now in your form you can read the query string (using JavaScript or Server Side) and process as required.


0

Instead of using radio buttons, you may be able to create a custom list which contains an "options" column as a single line of text and has the two options (Meat and Vegetable) within that list by adding them as items. Then, in the list form, you can have the form pull the "options" column from the custom list you just created through managed metadata. ...


1

The solution I would use instead of populating the options based on the selection would be to create two different fields in a list (meat options and vegetable options). With that you could throw in a simple script on a custom form to show the meat options when the meat radio button is selected and same thing for vegetables. This way all of your ...


0

Not sure if it is exactly the same, but I had a similar problem where some JavaScript code in a script editor web part only worked when the page was in edit mode. It started working normally when I added the language and type attributes to the script tags. See this answer.


1

This is happening because of Minimal Download Strategy, which is by default enabled on SP Online. To make it work, you should use SP.SOD.executeFunc https://msdn.microsoft.com/en-us/library/office/ff409592%28v=office.14%29.aspx This ensures that the specified file that contains the specified function is loaded and then runs the specified callback ...


0

If you have implemented a custom web part then why not set your drop-down value through your C#/VB.net code? I will give you an example of a C# code on how you can change the default value in a drop-down list on page load event. In below code "status" is your drop-down list name. protected void Page_Load(object sender, EventArgs e) { string ...


1

Try this: $(document).ready(function(){ if($("select[title='Status']").find("option:selected").val() == "Choose..") { $("select[title='Status']").val("InProgress"); } });


1

$(document).ready(function(){ if($("select[title='_title of column_'] option:selected").val() == "Choose.."){ $("select[title='_title of column_']").val("In progress..."); } }); not tested, but something like that should do it


0

Another, perhaps easier way, to redirect to a specific page after submission is to add the Source querystring parameter to the current page URL, like this: http://yoursite/path-to-your-edit-form.aspx?ID=someid&Source=/yoursite/path-to-your-display-form.aspx?ID=someid


0

In SharePoint instead of $(document).ready you should use _spBodyOnLoadFunctionNames for you this would look like this: _spBodyOnLoadFunctionNames.push("myCustomFunctionName"); function myCustomFunctionName(){ $('input[value=Save]').click(function() { var ur = window.location.assign; var URL = ...


0

I've learned a couple things that might help you. For one, you could use Firefox and Firebug to try to verify that the elements you want to select are being selected in the jQuery code. When I'm having trouble getting something to work using jQuery, I sometimes go back to writing it in javascript. I learned that selecting elements by the "ID" that you write ...


0

I fix it by switching to use Rest API :) var fileContentUrl = appweburl + "/_api/web/GetFolderByServerRelativeUrl('" + finalFolderUrl + "')/Files('" + fileName + "')/$value"; var info = { url: fileContentUrl, method: "GET", //headers: { "Accept": "application/json; odata=verbose", "X-RequestDigest": ...


0

In your Ajax code, we read: url: "/Layouts/SendUsEmail/Handler1.ashx", While it should be: url: "/_Layouts/SendUsEmail/Handler1.ashx", note the '_' in front of "Layouts".


0

Since the code for the initial set of show & hide seem so similar, it sounds like your second set of code isn't getting called. An alert statement inside of your code alert( ex: ("Hello World"); ) would help. You can also try changing the method you use to watch for the change to $("select[title = 'Field1']").change(function () { and see if you get ...


0

Thanks, you pointed me in the right direction. I only added the no conflict option. var j = jQuery.noConflict(); j(document).ready(function () { jRoot = _spPageContextInfo.webAbsoluteUrl; j.getScript(jRoot + "/_layouts/15/SP.js", function () { PageLoadTrigger(); }); });


0

I found the problem. The problem is with this ExecuteOrDelayUntilScriptLoaded(). It looks like in SP 2013 calling ExecuteOrDelayUntilScriptLoaded() doesnt work on published pages.In SP2013 this is the correct way to do it is like this SP.SOD.executeFunc('sp.js', 'SP.ClientContext', GetGroups); Once i have modified like this.It started Working like charm ...


0

not sure if it is a js script file that is not running but I had a same sort of problem with sp.js file (SP.ClientContext was not working). Solved it with this: $("document").ready(function () { var scriptbase = _spPageContextInfo.webAbsoluteUrl + "/_layouts/15/"; $.getScript(scriptbase + "sp.js", function () { //rest of my code }); ...


1

You can add the spinner by $(function () { $("div.spinner").show(); $('#jstree').bind("loaded.jstree", function (e, data) { // tree has been loaded $("div.spinner").hide(); }); });


0

I would suggest you, to use this "version" of bootstrap: http://bindtuning.com/cms/sharepoint/sharepoint-2010/theme/thebootstraptheme This is a customized bootstrap solution extra for sharepoints wich you can use.


1

You can use create_node for adding new nodes dynamically. http://www.jstree.com/api/#/?f=create_node([obj, node, pos, callback, is_loaded])


0

In your custom js file you can check whether jQuery has loaded or not. If not loaded then you can manually load it and then continue with your script. if (typeof jQuery != 'undefined') { alert("jQuery library is loaded!"); SP.SOD.executeFunc("jQuery.js, null, CustomScriptInit); } function CustomScriptInit() { //Custom script starts here }


1

That should work (it did through debugger for me). Have you tried putting it into the CSS attached to the master page (where these should be anyway)? Alternatively, you can try appending !important to the CSS code, which can bump it up in priority over any out of the box CSS code. ex: .ms-core-menu-list li[text='About Me'] {display: none !important;}


1

The problem with you code is that you are using the same SP.ClientContext object to make different concurrent requests with ExecuteQueryAsync. In this case your responses become corrupt, as a result you receive incorrect Task Id's. You can try three options: Inside JQuery each handler construct a new SP.ClientContext object instance and work with it like ...


1

You should reference the SP.RequestExecutor.js before the angular.js reference. <script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script> <script type="text/javascript" src="/_layouts/15/sp.js"></script> <script type="text/javascript" src="/_layouts/15/SP.RequestExecutor.js"></script> <script ...


3

It looks like you omitted parentColumn and childColumn. This needs to be present for the script to work, otherwise it doesn't know what fields on the form to manipulate. parentColumn The DisplayName of the parent column in the form childColumn The DisplayName of the child column in the form Correct code should be: ...


0

As Amal said you should try not to put duplicate code blocks on your page. You could either make your code generic (looks up the web part GUID etc.) or use just one codeblock for both. Answer for one code block In jQuery you can use a selector with a comma as separator such as [webpartid="firstID"],[webpartid="anotherID"] to find both target Web parts' ...


0

Actually we developed something that handles both the jQuery references and both charts requirements (although not hightcharts). You can check it out in this video. So you can use something like this to style your list views without even coding, I am not sure if the look and feel of charts there match what you need, but that would give you a fast solution ...


0

You can dynamically remove the old jQuery using below JavaScript var targetelement="script"; var targetattr="src"; var oldJqueryFileName = "jquery.min.js"; var allsuspects=document.getElementsByTagName(targetelement); for (var i=allsuspects.length; i>=0; i--){ if (allsuspects[i] && allsuspects[i].getAttribute(targetattr)!=null && ...


0

I have fixed my problem by not looking for a click event but a mousedown event on the table. The code: <script src="https://code.jquery.com/jquery-1.7.1.min.js"></script> <script> $(document).on("mousedown", ".ms-itmHoverEnabled", function(e) { var clickedId = this.id; if (clickedId != "") { var realId = ...


0

I've had some success using the LiveQuery jQuery plugin in the past: https://github.com/hazzik/livequery/ It's a little out of date now, so there may be a more current method. Basically, this binds to elements that may not have appeared yet, and then executes a callback when an instance of the element arrives. So you could have: ...


0

You need to set z-index on your overlay to be higher that the elements that can be seen through.


0

My understanding is that you want to load an edit form. My suggestion would be to use a dialog box instead of a pop up. Pop-up is probably going to get blocked by a lot of browsers, especially your network has strict policies. http://blogs.msdn.com/b/sharepointdev/archive/2011/06/23/how-to-open-a-list-form-in-a-modal-dialog-box.aspx <input ...



Top 50 recent answers are included