Hot answers tagged

4

The ID is an object property, so you need to access it like an object property using the square bracket notation instead of dot notation: var array = ["ID", "Title"]; data.d.results[i][array[0]]; Using the bracket notation, JS will translate [array[0]] into [ID] which is equal to .ID (notice the dot). Using the dot notation, JS expects array[0] to be an ...


1

It seems like clientContext.executeQueryAsync(succeededCallback, failedCallback) is missing from you code. You will be able to access list data in succeededCallback function only. Please refer msdn link for you reference.


1

The page reloads when you click your link, so you need to put JavaScript on the page which on load: extracts the FilterValue1 query string parameter find the corresponding link applies the css Step 2 will be a lot easier if you add an id to each link So if you define your links like this: <a id="linkA" href="?FilterField1=FirstLetter&...


1

You should start using browser Dev tools. Using that inspect the element which shows you how it is rendered in HTML. What all attributes it has. Once you have this information, you can use appropriate jQuery selector to select the object and apply your logic (hide/show etc.) For example below screen the field name is "FieldName" and you can see the ...


1

OOTB way to achieve this is to make the User Name column as unique. This is only possible if the column is single select person or group column.


1

You can't use REST API to filter list view (for exemple your SPView: /TestList/AllItems.aspx) To filter list view you should use CAML query (in the list settings, you could edit your views, and ADD filter to fields of your list). (ou can group, and do operation like count/sum/avarage ....). The user will not view this filter (so give to it a good title). ...


1

To get the ListItem details using REST API, we have to call the below endpoint, https://webappname/sites/sitecollection_ name/_api/Web/GetFileByServerRelativeUrl('/Sites/sitecollection_name>/en-US/Pages/TVM3.aspx')/ListItemAllFields GetFileByServerRelativeUrl( <server relative url of a file>) ListItemAllFields property returns all field values ...


1

You can retrieve page properties from a Pages library using REST just like any other list/library. For the above URL you could get that item using the following REST URL: http://<webappname>/Sites/<sitecollection name>/en-US/_api/web/lists/getbytitle('Pages')/items?$filter=FileRef eq '/sites/<sitecollection name/en-US/Pages/TVM3.aspx' It ...


1

The SP.SOD.executeFunc function will always return undefined, as most SharePoint JS functions that run asynchronous code do. The third argument, your getPageTitle callback function, can be declared to return something, but that something cannot be captured by the SP.SOD.executeFunc function to be able to do var par = SP.SOD.executeFunc('sp.js', 'SP....


1

SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function(){ var par = getPageTitle(); //Do the rest of your logic here }); The third parameter is a callback function. The SP.SOD.executeFunc call doesn't actually return the value of your callback function. So you can supply your own callback function as above and do whatever you like (including ...


1

Use $(window).load(function() {}); instead of document.ready(). It seems your DOM is loading after you are calling the function. window.load will run after all DOM has been loaded completely.



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