Web scripting language.
9
votes
3answers
2k views
Grab a specific property bag using ECMA script
I am trying to grab a key/value pair from a specific property bag but can't find any documentation or example code on how to grab a property bag. Currently I can only seem to grab allProperties. Here ...
1
vote
3answers
874 views
How to Use ECMA CSOM to Set a Field of Type SPFieldUserValue
I have a JavaScript array containing the string representation of some usernames (domain\username format).
Using the JavaScript CSOM, what is the best way to create a new item and add those usernames ...
26
votes
9answers
7k views
How do I know if the page is in Edit Mode from JavaScript?
Is there a way to find out if a page is in Edit Mode from JavaScript?
I know in on the server-side can be found using SPContext.Current.FormContext.FormMode but I can't find any means of doing it ...
6
votes
2answers
4k views
Programmatically add JS/CSS to pages
I've created a Visual Studio SharePoint 2010 solution with an ASCX that adds some JavaScript files and CSS to the head of each page; this is based on this article. When I deploy the solution, it adds ...
5
votes
3answers
7k views
How to use JavaScript and CSS in a web part?
I am using SharePoint Server 2007 Enterprise with Windows Server 2008 Enterprise. I am using publishing portal template. I am developing using VSTS 2008 + C# + .Net 3.5 + ASP.Net. And I want to ...
3
votes
1answer
344 views
structure of sharepoint javascript functions
I am trying to understand more the structure of javascript functions in SharePoint. Why does every function begin with som value than colon and semicolon like ULSrE8:; in spgridview.debug.js:
...
5
votes
4answers
787 views
How to access a Web application/Farm level property bag via jQuery/Javascript/ClientContext
It it possible to access the Web application/Farm level property bag using jQuery/Javscript/ClientContext? If not, then what are the possible alternatives to access Web Application Farm level property ...
4
votes
4answers
6k views
Javascript to display sharepoint list items on page load
With Client Object Model API and a bit of javascript, I want to retrieve the items of a sharepoint list and display them into the web page, when the web page loads.
I've successfully implemented ...
4
votes
6answers
7k views
How do I determine a user's SharePoint group membership using the client object model?
I want to redirect users from a landing page to another page in SharePoint 2010, based on their group membership. I need to do this using JavaScript (ECMAScript) and not server side code.
4
votes
2answers
1k views
Sharepoint 2010 ModalDialog title
I am creating a popup window in sharepoint using this code in javascript.
function openDialog(title, url, width, height, CallResult) {
var options = { url: getUrl(url),
title: title,
...
4
votes
8answers
9k views
Getting a count of list items in a list via ECMAScript
I have a SharePoint 2010 web site with a master page that has a counter on it. I'm trying to update that counter using the ECMAScript. The code I have falls nicely into the success method - but I ...
2
votes
4answers
1k views
How can I Make a Dropdown box in a Form Field Conditionally Read-only/locked?
I have a drop down box form field (with values level1,level2) in SharePoint list. How can I lock the drop down box selection in the edit form.aspx whenever the condition is level2?
4
votes
4answers
2k views
What is the proper way to add jQuery to a MasterPage?
Currently I am using this method in the header:
<script src="/_layouts/MNCAssets/scripts/jquery-1.5.1.min.js"></script>
But for some reason, my webparts that use jQuery don't appear to ...
1
vote
2answers
1k views
PreSaveAction is not firing
Any idea why the PreSaveAction is not firing. I am trying to take the user to a thankyou page when they complete a survey. I added this js thru SP Designer to NewForm.aspx.
<script ...
1
vote
1answer
4k views
How to retrieve a ListItem using the Javascript Client Object Model?
Right now I am using this method:
function getWebProperties(id) {
var ctx = new SP.ClientContext.get_current();
this.website = ctx.get_web();
this.listCollection = website.get_lists();
...
1
vote
0answers
461 views
Get group membership of current users using ECMAScript [duplicate]
Possible Duplicate:
How do I determine a user's SharePoint group membership using the client object model?
How can I use the client object model to get a list of all (SP) groups the ...
0
votes
0answers
47 views
How to show the library items based on the lookup of contacts column in another list using ecma script?
I have a document library which contains multiple documents.
and i have a list which contains two columns DocumentName and Contacts.
My scenario is, I want to show the library item which is created ...
0
votes
1answer
308 views
AllItems View of Query String: can I group using value in query string?
Can I somehow how a query string to show a group of documents within a given library. Not one single item, but the AllItems like view. So within the library I have a grouping type of id value in a ...
26
votes
6answers
18k views
How do you get the current list item in JavaScript?
There's all kinds of ECMAScript class library examples around but all of the ones I find show how to retrieve all list items (through SP.ClientContent) but how do you get the current list item? I'm ...
5
votes
2answers
826 views
How to retrieve distinct values with JavaScript Client Object Model
How can you get distinct values from a SharePoint List column using JavaScript without a huge performance hit?
A simple example would be appreciated :)
6
votes
1answer
1k views
Context Menus - Send To not working in IE9
I have a document center with a custom master page. The page is designed with IE9/HTML5/CSS3 in mind. In my other question, I worked out how to fix the IM Presence icons by fixing some core ...
5
votes
2answers
3k views
Get the current UI language with ECMAScript
Is it possible to get the display language from within ECMAScript?
Similar to http://www.sharepointoverflow.com/questions/3129/get-the-current-ui-language-from-a-webpart, I'd like to get the user's ...
4
votes
2answers
1k views
How to read a column type SPUser, DateTime, Currency with EcmaScript?
I have a list in SharePoint 2010 with some columns. All are default types. So I have
"Single line of text"
"Multiple line of text"
"Date and Time"
"Choice"
"Number"
"Currency"
"Person or Group"
...
3
votes
1answer
722 views
SharePoint RTE: How to attach to mousedown events (like bold, italic does)
When clicking on bold text in the RTE (rich text editor), magically the ribbon button for bold: get's activated.
The same happens for the other format option buttons you can see on the screenshot. I ...
2
votes
2answers
2k views
Scroll position in Sharepoint 2010?
Do you know a way to find out a scroll position in JS or jQuery on a page in Sharepoint 2010? I have a web part that is very big (high) so scroll on the page appears. But I cannot determine the scroll ...
1
vote
2answers
517 views
How to get value of List Filter web part in Javascript?
I use the SharePoint List Filter web part on a page to control several Data View Web Parts.
How do I read the current value of the List Filter in Javascript?
5
votes
4answers
3k views
Get current web url in a SPRibbon Custom Action Command
I've a SPRibbon custom action with the purpose of open an custom app page in a modal dialog,
but I'm getting troubles for getting the current web URL, as well, set a reference for a .js with the right ...
5
votes
5answers
1k views
Include JavaScript in a feature
I remember seeing somewhere that you can include an external JavaScript file in a SharePoint feature if it is in the _layouts folder. For the life of me I can't remember how to do this!
5
votes
3answers
2k views
Site Assets vs. Style Library
I usually store my JavaScript/jQuery files in the Site Assets library, but I see on forums that others are using the Style Library.
What are the respective benefits of each?
4
votes
3answers
5k views
Cannot get field value of list item through JavaScript
I try to get the value of a list item (that is currently selected). I know that I must load it into the context but even with loading the field explicitly I get the following message.
Microsoft ...
4
votes
1answer
1k views
How to get a value included from a lookup column using the javascript Client Object Model?
Related:
How to retrieve a ListItem using the Javascript Client Object Model?
In my previous question I was able to successfully retrieve a basic value from a list item. My problem is that I am now ...
4
votes
4answers
7k views
“the HTML source you entered might have been modified”
"the HTML source you entered might have been modified"
In SharePoint 2010, this is the scary message you get everytime you use the "edit HTML source" button with the Content Editor Web Part.
In ...
2
votes
4answers
3k views
Loading jQuery in the Correct order
I wish to use a jQuery plugin in SharePoint. Currentley I have jQuery added to each page via a custom master page.
<script src="/Style Library/js/jquery-1.6.4.min.js" ...
2
votes
1answer
251 views
Sharepoint 2010 alternative to SetCtrlFromOpt
I have been tasked with debugging custom javascript which was originally written for 2007 by a 3rd party vendor. The 2007 site has upgraded to 2010 and the javascript has stopped working.
The one ...
2
votes
1answer
842 views
Getting date and time from SharePoint Server 2007 and throw it to Javascript variable
How to I get the date and time from SharePoint Server 2007 and pass this value as a Javascript variable?
1
vote
0answers
238 views
Load full list XML into JavaScript variable via CEWP
Currently I am using the lists.asmx webservice to POST a soap envelope and return specific list items. I really want the whole contents of the list. I realize how large that might get, but if this ...
1
vote
3answers
829 views
jquery and javascript : can i get the last ID from document library?
Is there a way to get the last ID from a Document Library with javascript/jquery?
1
vote
1answer
878 views
Reference a javascript script in a ribbon custom action xml
Reference a .js file on a spribbon custom action elements.xml
on my javascriptmethods.js file:
function test(){
alert('test message.');}
on my custom action elements.xml:
<CustomAction
...
3
votes
3answers
347 views
ECMA script - retrieving SPList property bag
I have added a property bag to SPList. Since the SPList doesn't support property bag, I have added my custom property to SPList.RootFolder.Properties. I would like to retrieve this property using ECMA ...
3
votes
8answers
4k views
How can we get Cascading Lookup Columns in sharepoint 2010?
How to get the cascaded Lookup columns in sharepoint 2010,Iam having requirement
like i have two lists(Category List and Sub category list)..For each item in category
list i have 5 different items ...
3
votes
3answers
1k views
Javascript to get GUID from SharePoint
I am newbie to SharePoint and I am uploading a file to the server using javascript. Now the task is to get the GUID of that file and display it ({alert(guid); is fine).
I don't even know where to ...
3
votes
2answers
1k views
SPservices to retrieve version history of items in SharePoint List 2007?
May I know how can one use SPServices to retrieve all the version history of a particular items in a SharePoint 2007 Server List? (If it is not possible via SPServices, are there other Javascript ...
3
votes
1answer
301 views
Can I use JavaScript in 'Edit in DataSheet' mode?
I would like to use some JavaScript in 'Edit in DataSheet' mode to check a value and prompt a user to enter some text.
Is this possible?
2
votes
1answer
669 views
no sorting with JavaScript Client Object Model?
I have the following JSOM code:
var query = "<View><Query><Where><Eq><FieldRef Name='Category'/><Value ...
2
votes
3answers
555 views
Can a web part prevent master page jQuery from executing properly?
I'm including jQuery and a custom .js file into the master page of my SharePoint 2010 site. In the $(document).ready() function, I'm setting a live event handler on an element in the header of the ...
2
votes
1answer
7k views
Calling the SP.UI.ModalDialog.showModalDialog method
My SharePoint solution has a userControl that Register a js block
string getJS(string title, string htmlContent)
{
return (string.Format(@"
ExecuteOrDelayUntilScriptLoaded(function ...
2
votes
3answers
575 views
Expected ; on javascript
I got the following code in my elements.xml, but I cant find the error.
My ribbon is broken, the error says, expected;.
But I see no error, yet, maybe fresh eyes can see it.
See the EnabledScript ...
2
votes
2answers
2k views
How to get list by url using client object model?
Is it possible to get list by url using ECMA script client model?
For example something like this:
context.get_web().get_lists().getByUrl("Lists/MyList");
2
votes
3answers
524 views
Where do you deploy scripts that are loaded in a masterpage?
Do you deploy the script files to "_layouts" or the content database?
If "_layouts," do you use a <ScriptLink> tag or a <script> tag?
1
vote
1answer
49 views
How to open file in adobe reader using command line without checkout from Javascript?
I am working on print functionality. I am printing the PDF files (uploaded in SharePoint Library) using Adobe Reader command line from javascript. I am using ActiveX object to call the cmd. refer ...