Hot answers tagged

2

Try following steps: Run npm i modernizr and then npm i @types/modernizr --save-dev. Then add its reference to config.json in externals{} like: "externals": { "modernizr": { "path": "node_modules/modernizr/src/modernizr.js", "globalName": "modernizr" } } Then reference the file in your WebPart.ts file like: ...


1

If you execute the items API call without any filter, you will get a result set that contains all the items in that list. Maybe not a problem if the list only contains a small number of items, but obviously lists can potentially contain thousands of items and that would not perform well. The following example gets just retrieves the most recently modified ...


1

This can be done using CSS only. .ms-standardheader[id=columnInternalName] { display: none; } Or hiding all the labels using CSS: .ms-standardheader { display: none; } Or by using jQuery (ID): $(".ms-standardheader[id='columnInternalName']").hide(); Or hide all the labels in the list form $(".ms-standardheader").hide(); Can be done with plain JS to: ...


1

Use SP.SOD.executeFunc('clientpeoplepicker.js', 'SPClientPeoplePicker', function () { var neededPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[GiveTheIndexHere]; var usrObj = { 'Key': 'i:0#.w|domain\user' }; neededPeoplePicker.AddUnresolvedUser(usrObj, true); }) Adding my complete code below. The requirement was to auto-populate ...


1

Try using below code: //Display name of your field var fAssignedTo = "Assigned To"; $(document).ready(function(){ BindPeoplePickerWithLoggedinUser(fAssignedTo); }); function BindPeoplePickerWithLoggedinUser(ppTitle){ setTimeout(function(){ var _PeoplePicker = $("div[title='" + ppTitle + "']"); var peoplePickerEditor = ...


1

Try using code something like below: <div id='ImgContainerDiv'> </div> <script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script> <script type="text/javascript"> $.ajax({ url: _spPageContextInfowebroot.webAbsoluteUrl + "/_api/web/lists/getbytitle('ListName')/items?$select=ID,Title,...


1

Assuming there is valid justification in your unspecified backstory of why you are reformatting with jQuery instead of using the native XSL in the Content Query: You should use the jQuery .each() (see jquery docs) method to perform an operation on each selected item. Each instance call of the loop makes the this keyword a reference to the currently ...


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