New answers tagged

3

Actually haven't had my coffee jet and read your question like you needed help with MDS - if you wan't to enable MDS again (which you should do because it's actually awesome), below are some hints that will help you. Some troubleshooting help for your problem: Check your browsers console for errors Access the service via the URL directly (via browser ...


0

With jQuery and JSOM you can achieve this Get the list items and store it in an array of JavaScript objects Find a suitable jQuery table plugin that supports Filtering, Sorting etc Bind the data to the plugin Drawbacks of this approach is you need to load whole data in the client side. If you are dealing with 1000's of list items then it will have ...


0

You are using input instead of select in your script. Try following script: $("select[title='fieldname']").attr('class', 'form-control')


1

The solution that Erin is fully explained in this blog post. It is using the SPServices to query the Picture Library and Bootstrap Carousel to render. The other option that I used in a very recent project was the solution provided in Sharegate web site and I do think it is a more robust solution since it is using Content Search Web part with a custom display ...


0

If I understand your question correctly, you are asking how to stack asynchronous calls so that the second function only executes when the first is complete. Look into jQuery deferreds, they allow you to do exactly this: api jquery com Take this as an example: _spBodyOnLoadFunctionNames.push("Init"); function Init() { Func1().done(function() { ...


8

Document ready event gets fired when the DOM get loaded. This doesn't necessarily guarantee that the JS files required for SharePoint JSOM is already loaded. The best way is SP.SOD.executeFunc('sp.js', 'SP.ClientContext', readyFunction); function readyFunction() { Function1(); Function2(); Function3(); }


0

<style type="text/css"> .groupheader:before{ content:"+"; font-weight:bold; padding-right:10px; } .minus:before{ content:"-"; font-weight:bold; padding-right:15px; } </style> </script> <script type="text/javascript" > $(document).ready(function(){ $('.cbq-layout-main li ul').hide(); $('.cbq-layout-main ul ...


0

This is what I ended up doing: itemCount = 0; runCount = 0; arrLists = ["Migrated 2011", "Migrated 2012", "Migrated 2013", "Migrated 2014", "Migrated 2015 A - F", "Migrated 2015 G - P"]; arrYears = [2011, 2012, 2013, 2014, 2015, 2015]; ExecuteOrDelayUntilScriptLoaded(Initialize, "sp.js"); function Initialize() { ctx = new ...


0

If you paste the code in the browser console and it works you may need to wait for the elements to appear in the DOM before attaching the click event. To do something like this you can use an timer that will check if the element is present in the DOM, when it finds the element the timer stops and attach the events to the elements. Something like this might ...


0

Try placing your code in "content place holder main" in editform.aspx


-1

If you are referencing to the js file, just remove those lines from the js file, use them only when embedding in HTML or ASPX page. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type=text/javascript> Your function </script>


2

The condition of "if" is missing the character $ or the word jQuery, that identifies you are using a jquery selector for the element. Try to replace it for: if ($("input[title$='Phone Data Collection']").is(':checked'))


0

The easiest way to do it, is to add this CSS to a Script Editor: <style> li.ms-core-menu-item[text="TEXT(of the entry which should be hidden)"] { display: none !important; } </style>


1

What you could do, is to override the function in Core.js on the current page instead. If its a library the actions are added in the AddDocLibMenuItems. And the View/Edit Properties are added from the AddShareNamespaceMenuItems function. So you could add this function to your page, just make sure its loaded after Core.js: function AddDocLibMenuItems(m, ...


0

You can use the following code to check whether current user is site admin or not. var user = SP.ClientContext.get_web().get_currentUser(); var value = user.get_isSiteAdmin ();


0

isSiteAdmin gets you Site Admin info, not Site Collection This might be easier: _spPageContextInfo.isSiteAdmin


1

You can do this even without using $(document).ready(function(). Attach JS in your webpart. <script src="/sites/DevNum/testjd/SiteReformeTest/js/palette.js"></script> You just need to remove $(document).ready(function(){ from your code. Write only below function in your JS file. function getItemsToBeUpdated() { ... ...


1

You should try below code without $(document).ready(function(){ $( "#palettebutton" ).click(function() { ---------- Your code will be here ---------- alert( "Handler for .click() called." ); });


2

Base on your code, the value you get is a string not an object. so the code : var relateditmid = relateditm[0].ItemId; will return the item ID after converting the string relateditm to Object using eval funtion. var relateditmObj = eval(relateditm); var relateditmid = relateditmObj[0].ItemId;


1

What is Survey in SharePoint 2013? Survey a special kind of list that enables the owner to create questions, have multiple people to respond, and summarize the results. You can use surveys to ask people what they think about issues, how to improve your processes, and many other topics. You can collect the results by using several different types of ...


0

I discuss how to get started with jQuery (including how to deploy and reference the library) in this conference session: JavaScript and jQuery for SharePoint Developers


1

.ui-accordion .ui-accordion-content { padding: 1em 2.2em; } The issue is with this css. If you change it to px instead of em, it functions correctly.


0

If I understand correctly, you have a form in a Sharepoint page. In that form, there's some fields to complete, like first name, surname, mobile... When you click AddAccountRow, the values entered in your form are inserted into a table tableAc. Then, when someone pressed the submitdata button, all data inside the table tableAc are posted to a Sharepoint ...


1

Just resolved my issue. I referred to this question's answer and added .attr('onclick', '') This clears the onclick attribute in the html. So my code now looks like this: $(document).ready(function(){ $("table#idAttachmentsTable a").attr('onclick', '').click(function (event) { event.preventDefault(); var ...


3

You can put <script type="text/javascript" src="/_layouts/Scripts/jquery-min.js"></script> in master page to access this javascript globally in all pages. Or you can put that script tag in your custom webpart / content editor webpart / script editor webpart to access that script only for that webpart only.


2

The MVPs are busy with https://github.com/ngOfficeUIFabric/ng-officeuifabric/ which has a Table component: http://ngofficeuifabric.com/demos/uifTable/ You need to go for AngularJS and do more programming yourself, jQuery dataTables is more plug and pray


2

Have you looked at datatables? https://editor.datatables.net/examples/advanced/deepObjects.html


0

You can do something like that: <script> var targetListItem; var listName="js"; var itemId=1; ExecuteOrDelayUntilScriptLoaded(GetListItem, "sp.js"); function GetListItem(listName,itemId) { var clientContext = new SP.ClientContext(); var targetList = clientContext.get_web().get_lists().getByTitle(listName); ...


0

i solve above issue with help of below link. http://ecarlos.net/post/2012/10/19/Get-PeopleEditor-(PeoplePicker)-values-in-sharepoint-2010-using-SPServices.aspx basically SPFindPeoplePicker search for label name of column. if you have required field * mark next to you field name then spserivce did find column name. just remove or shift * mark from label ...


1

You may need to wrap or delay that function until SharePoint controls finish loading that with _spBodyOnLoadFunctionNames: So: function fireOnListItems(){ $( ".wj-cqwp-ProjectDashboard ul li" ).each(function() { // big chunk of code above entered here }); } _spBodyOnLoadFunctionNames.push("fireOnListItems");


0

The whole essence of MDS is not to load (and execute) the same scripts again. You have to hook into the asyncDeltaManager to tell MDS you want something executed beside the initial load. asyncDeltaManager.add_beginRequest(function(){ //run on every MDS request }); There are more MDS events you can hook into: pageLoad, pageLoading, endRequest Note that ...


0

You can use OnValueChangedClientScript property of ClientPeoplePicker as follows: Markup: <SharePoint:ClientPeoplePicker ID="peoplePicker1" runat="server" ClientModeOnValueChangedClientScript="peoplePicker1_ValueChanged" /> JavaScript: var selectedUsers = []; function peoplePicker1_ValueChanged(elemId, userKeys) { if ...


1

At first glance (and its late saturday afternoon here, and the sun is out and its above 20 celcius for the first time, and I have had some beer) You are running into JavaScrip scoping issues: var passedData = { dfd: d, idx: i }; is the line that worries me, (it is almost a philosophical question... but that must be the beer) where does i come from? You ...


0

The way I have done it in o365 which I think it is the same SP 2013. results object had the user properties var results = data.d.results; var image = siteURL + "/_layouts/15/userphoto.aspx?size=L&accountname="; <div class='contact-item'><div class='contact-profile-image'><img src='" + image + results[i].Person.EMail + "'></div>


2

Thank you for the answer Hardik. The topic you linked to seems to be the best and only example of doing this. Even though, I came up with another solution (an easier version of it), so I am posting it as an answer, in case some other people find it useful in the future :) What I did: Created a global List "UsersActivities" Creted two columns in the ...


4

Extensive explanation, tutorial, etc.: Find Number of Users Currently Logged on to a SharePoint Site The gist of it is that you don't have OOTB features to show you the number of currently logged in users. You can check IIS for current users, but you don't know whether these are logged on or not. The solution explained in the blog article is ...


0

This is the code i use to get videos info from a "Asset Library", maybe this can help you. I don't know how to get the preview pic but should be right there: getDataFormVideosList:function(next){ var camlQuery = new SP.CamlQuery(); camlQuery.set_viewXml('<View>' + '<ViewFields>' + ...


0

Below mentioned code is used to add user to SharePoint group. You will get idea from below mentioned sample code. UPDATED CODE public void AddUserToDMSite(string useremail, string securityGroupName, Web aWeb) { GroupCollection collGroup = aWeb.SiteGroups; Group oGroup2 = ...


0

There are multiple issues with your code. Below are the issue and updated code You are querying the same list item on load as well as on edit button click. You can improve this by storing the list item and use it on edit On EditList function you are trying to use undefined object oListItem I have updated your code as below <h1 ...


0

Please Update "editList" function as follows and let me know if it is working - function editList() { var qString = window.location.href.split("?ID=")[1]; var clientContext = new SP.ClientContext.get_current(); var oList = clientContext.get_web().get_lists().getByTitle('DemoList'); var oListItem = oList.getItemById(ItemId); //ItemId ...


1

Like Amal Hashin said, you've opened a <FieldRef>, but you should close it like that : <FieldRef Name='Mise à jour parc' /> <Value Type='Text'>Non</Value> Also I saw a mistake in your code. You use collListItemToBeUpdatedReventeas variable to print the result of the query. The problem is that you use that variable several times in ...


1

Your query is wrong. Try below query instead camlQuery.set_viewXml("<View> <Query> <OrderBy> <FieldRef Name='Mise à jour parc'> </FieldRef> </OrderBy> </Query> </View> ");


0

Can you try with this SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function(){ getItemsToBeUpdatedReventeTot(); getItemsToBeUpdatedReventeMaj(); }); Hope this should work. or you can also try with _spBodyOnLoadFunctionNames.push("getItemsToBeUpdatedReventeTot"); _spBodyOnLoadFunctionNames.push("getItemsToBeUpdatedReventeMaj");



Top 50 recent answers are included