25.05.2012 v2.7: Added support for frozen list view header in Chrome and Firefox in addition to the existing IE support.
17.05.2012 v2.6.3: Fixing positioning error in IE when scrolling and added a method of clearing a datepicker value by hitting the Delete key when the datepicker is active.
19.02.2012 v2.6 fixed a bug when trying to save “<”, “>” or “&” in a text field. Changed the script to use spjs-utility.js. Note that this version requires jQuery v1.6.4 or newer.
19.02.2012 v2.5 fixes bugs with “pinTableHeader” and grouped views.
28.09.2011 v2.4 fixes a bug preventing this to work with folders.
11.08.2011 v2.3 fixed a bug (from v2.2) that made it impossible to use the solution in document libraries. I have also changed the variables passed to the function “initCustomEditFunction” to an object literal. See updated CEWP below.
08.05.2011 v2.2 makes it possible to use this solution in a web part page alongside other list view web parts.
NOTE:
You can have only one list view web part with this feature activated in one web part page.
Both the CEWP code and the file “inlineEditingForSP2007.js” has changed.
09.02.2011 v2.1 released with this modifications:
Modified the “hover” CSS to highlight the editable TD’s only, and to show a small downarrow in the bottom right corner of the TD.
I have previously created a solution for editing items inline in a list view. You find it here This solution did not support choice fields or multi line text fields.
I stated a long time ago that i would update the solution to support choice fields, but never had the time to implement it. This added feature was requested a few weeks ago, and i had to deliver…
I will put this in a new post as it is completely rewritten.
This solution features inline editing of the following field types in plain list views and in grouped views:
- Date and Time
- Single line of text
- Number
- Currency
- Yes/No
- Person or Group (Single choice)
- Dropdown choice
- Radio buttons
- Checkboxes
- Multiple lines of text (Plain text)
Hover:

Edit:

In Internet Explorer the list view heading row will scroll with the page. This feature is supported in IE only as you cannot have a <tr> with css position:relative in any other browser, and i haven’t had the time to find a workaround.
The code is tested in IE8, Firefox 3.6.13, Chrome 9.0.597.84 and in Safari 5.0.2
It runs much faster than the previous solution – even in large list views. This is due to the method it is created – addressing the <tr> and not each <td> in the first pass. The <td>’s are processed on hover over the <tr>.
You must have the ID column in the view for this solution to work. If you use the option to hide the ID column, it has to be positioned to the far right in th view.
The fields are edited “one at the time” and you must save changes for each individual field.
This solution relies upon “Google Libraries API” to host the jQuery and the jQueryUI. If you prefer local copies, edit the script src in the CEWP code.
Download the code
Get the latest version of the file “InlineEditingForSP2007.js” from here
Put this in a document library or a folder made in SharePoint Designer. Make sure all users have read access to the location. When inserting the CEWP code below, make sure to update the src to reflect your locale copy of the file “InlineEditingForSP2007.js”.
Add this code to a CEWP below the list view
For v2.0-2.2
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" rel="stylesheet" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<script type="text/javascript" src="/test/English/Javascript/EditInListView/inlineEditingForSP2007.js"></script>
<script type="text/javascript">
// Set variables
var dateFormat = 'm/d/yy';
var boolYesNoText = 'Yes|No';
var arrToEdit = [];
// If there are only one list view web part in the page, we can rely upon SharePoint to provide the list GUID:
myListGuid = ctx.listName;
// To use the solution in a web part page with more than one list view web part you must provide the list GUID manually:
//var myListGuid = "{B9F1D8CF-83DB-4E1A-BF61-752BCB40B2CF}"; // Change this GUID to match your's
// This parameter specifies whether to pin the table header to the top of the screen when scrolling (IE only)
var pinTableHeader = true;
// The symbol used to mark the boundary between the integral and the fractional parts of a decimal number
var decimalSeparator = '.';
// Hide the ID column
var hideIdColumn = true;
// Call function
initCustomEditFunction(hideIdColumn);
</script>
For v2.3+
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" rel="stylesheet" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<script type="text/javascript" src="/test/English/Javascript/EditInListView/inlineEditingForSP2007.js"></script>
<script type="text/javascript" src="/test/English/Javascript/spjs-utility.js"></script>
<script type="text/javascript">
var argObj = {dateFormat:'m/d/yy',
decimalSeparator:'.',
boolYesNoText:'Yes|No',
labelArr:['Save','Cancel','Clear'],
arrToEdit:[],
myListGuid:'B9F1D8CF-83DB-4E1A-BF61-752BCB40B2CF',
pinTableHeader:true,
hideIdColumn:true};
initCustomEditFunction(argObj);
</script>
New in v2.6
I have removed some functions from the file “inlineEditingForSP2007.js” and you must refer spjs-utility.js in the CEWP
Parameters explained:
- dateFormat: This must reflect the current regional settings for the picker to “pick up” the date in the field and display it correctly in the datepicker.
- boolYesNoText: Used to display Yes or No in the field when it is changed. Only cosmetics as the “real” value is 0 or 1.
- labelArr: The text on the links when in edit mode on a field. New in v2.3
- arrToEdit: Optional. To restrict edit to a selection of fields, enter them here by FieldInternalName in an array format. Defaults to All editable fields in the current view.
- myListGuid: If there are only one list view web part in the page, we can rely upon SharePoint to provide the list GUID using
myListGuid = ctx.listName - myListGuid: To use the solution in a web part page with more than one list view web part you must provide the list GUID manually
myListGuid = PutTheListGuidHere - pinTableHeader: This parameter specifies whether to pin the table header to the top of the screen when scrolling (IE only)
- decimalSeparator: The symbol used to mark the boundary between the integral and the fractional parts of a decimal number
- hideIdColumn: The argument passed in the function call – true to hide the ID column, false to keep it visible.
Read here how to find the list GUID
Please ask if anything is unclear.
Alexander
November 3, 2011 at 5:05 am |
[...] Inline editing for SharePoint 2007 « SharePoint JavaScripts – [...]
December 14, 2011 at 4:49 pm |
Hi Alex,
Will this work on an XSLT dataview?
December 15, 2011 at 12:04 am
No, it will not work unless you adapt the code to match *your* dataview.
Alexander
January 24, 2012 at 11:52 am |
Hi Alex,
I have set the javascript in the CEWP and I am not able to find the changes. Here, do i need to have date, bool field inorder to set this to work. I have all field as a single line txt in my list.
Thanks
Arockiaraj
January 24, 2012 at 1:11 pm |
src=”https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js”>
src=”https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js”>
src=”serverurl.”>
var argObj = { dateFormat:’m/d/yy’,
decimalSeparator:’.',
boolYesNoText:’Yes|No’,
labelArr:['Save','Cancel','Clear'],
arrToEdit:[],
myListGuid:’B86BA39E-B0D3-4E5A-A16B-83027880CFB7′,
pinTableHeader:true,
hideIdColumn:true};
initCustomEditFunction(argObj)
I am left anything in the code
Please let me know
Thanks
Raj
January 28, 2012 at 1:12 am
Hi,
If you have made the changes to the “argObj” as described in the “Parameters explained” section, you should be good to go.
If you still do not get it right, send me some screenshots and I’ll see if i can spot the error.
Alexander
January 26, 2012 at 12:55 am |
Would it be possible to refresh a calculated column after updating a value? Let me clarify: When I pick a value from a list, I have a few calculated columns that refer to that value that do not “recalculate”. Is that something you can consider for a future release?
January 28, 2012 at 1:20 am
Hi,
It’s not possible to reload only the calculated column (not without a lot of hassle that is), but by adding this line:
after line 437, you should get a page refresh after each “save”.
The reason for using this rather odd “command” and not using location.reload() has to do with SharePoint trying to repost changes made to the page if reloading using the latter .
Alexander
February 7, 2012 at 7:07 am |
Hi, great solution! I have a couple questions:
1. I can’t get the pinTableHeader to work. I’m using IE 8.0. Am I missing something obvious?
2. Is it possible to make this work in a grouped view?
Thanks!
February 19, 2012 at 9:39 am
Hi,
There were some bugs in v2.4. I have fixed both these issues in v2.5.
Alexander
February 17, 2012 at 11:57 pm |
Can I have multiple list views on a webpart page with the inline functionality? Thanks.
February 19, 2012 at 9:53 am
You can have multiple list views in the same page, but only one of them can have this functionality activated.
Alexander
February 24, 2012 at 10:23 pm |
Hi Alexander,
I still love this site after all this time. I’ve got this working very easily. There are two things though: 1. I can’t seem to force it to make sure required fields are filled in. 2. The date function seems to be broken for me.
Thanks as always. This is such a huge resource for me.
February 27, 2012 at 6:56 pm
Hi,
This solution will not ensure required fields are filled. In fact every field edited requires a separate postback (save) and I cannot implement this without putting in many hours of customization.
What is it with the date field that does not work?
Alexander
February 27, 2012 at 7:05 pm
Thanks. Basically if the field is set to be a date when I click it, it erases the field from view and no pop up comes up. The line turns red and the arrow at the bottom disappears. If I go back to it the previous entry remains. I’ve tried to leave the script as you wrote it and altered it (m/dd/yyyy) but it won’t work with a date field. Maybe I’m missing something?
Thanks for your reply!
February 27, 2012 at 7:09 pm
Are you sure you have referred jQueryUI correctly?
Alexander
February 27, 2012 at 7:15 pm
Wow. That fixed it. It’s odd that it worked at all though. What I did was I had a local copy that was 1.3.2. When I made it 1.4.2 it worked!
February 27, 2012 at 7:14 pm |
Wow. That fixed it. It’s odd that it worked at all though. What I did was I had a local copy that was 1.3.2. When I made it 1.4.2 it worked!
Thanks – you are the master!
February 28, 2012 at 2:26 am |
Great script. I use it a lot. We have the following issues:
1. When I type an “&” or an “<", the script will not save the row and a red background is produced.
2. When I edit again and type the same text but leave out the special symbols, the save works, but the background still shows "red" when saving.
Thanks
March 4, 2012 at 11:47 pm
I have fixed this bug in v2.5.1.
Alexander
March 5, 2012 at 12:25 am
Sorry, but I have pulled v2.5.1 as I see that I need to do some more to support newer versions of jQuery.
If you want to fix this specific issue, change line 289 to this:
content.push("<Field Name='"+fin+"'><![CDATA["+val+"]]></Field>");Alexander
March 9, 2012 at 8:38 pm
Hello Alexander, This works during the save operation. There is an issue displaying this. If you type in a field the following text:
R&D
Then after the save, it will show as
R
Then when you click to edit it again, it shows
R&D
So the data is there, it is just not getting displayed
Oddly, if I just add one character more to the text, like a period or a space, it will show correctly.
For example
R&D.
shows ok.
Thanks again.
Michel.
February 28, 2012 at 2:28 am |
With version 2.5, the pinTableHeader works now for us, but when there is a group by in the list, the script does not seem to work. I don’t get the blue backgrounds on mouse over.
Thanks!
March 5, 2012 at 9:09 pm
Hi,
This should work in v2.5. I have tested it in IE9 – which browser do you use?
Alexander
March 9, 2012 at 7:46 pm
I am using IE 8.0.6001.18702
thanks!
Michel
March 5, 2012 at 7:26 pm |
We are using the inline editing v2.0-2.2 on a couple of our sites and it was working perfectly until today. No changes have been made, but only the highlight works and the editing feature doesn’t. Please advise if you have come across a similiar problem. Thanks
March 5, 2012 at 9:10 pm
Have you updated to a newer version of jQuery?
If so, try out v2.6, but note that you must update the CEWP code.
Alexander
March 5, 2012 at 10:11 pm
No we haven’t made any updates.
As an aside I jut tried to run the newer version which didnt work. Here is the code:
var argObj = {dateFormat:’m/d/yy’,
decimalSeparator:’.',
boolYesNoText:’Yes|No’,
labelArr:['Save','Cancel','Clear'],
arrToEdit:["Apply"],
myListGuid:’1f87d67b-189f-402d-8685-cc878a3b6cf4′,
pinTableHeader:true,
hideIdColumn:true};
initCustomEditFunction(argObj);
March 5, 2012 at 10:33 pm
Update:
I changed arrToEdit to the following and its still not working:
arrToEdit:['Apply'],
March 5, 2012 at 10:48 pm
Read here how to post code in comments
Have you referred spjs-utility.js?
Alexander
March 5, 2012 at 11:24 pm
I will try again. Below is my code and yes spjs-utility.js is included.
//<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> //<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script> //<script type="text/javascript" src="http://ops/operationscontrol/infoctrl/melissa_tests/Shared%20Documents/InlineEditingForSP2007.js"></script> //<script type="text/javascript" src="http://ops/operationscontrol/infoctrl/melissa_tests/Shared%20Documents/spjs-utility.js"></script> //<script type="text/javascript"> //var argObj = {dateFormat:'m/d/yy', // decimalSeparator:'.', // boolYesNoText:'Yes|No', // labelArr:['Save','Cancel','Clear'], // arrToEdit:['Apply'], // myListGuid:'1f87d67b-189f-402d-8685-cc878a3b6cf4', // pinTableHeader:true, hideIdColumn:true}; // initCustomEditFunction(argObj); // </script>March 6, 2012 at 4:28 pm
The code still isn’t working for us. Any ideas?
Thanks.
March 6, 2012 at 4:32 pm
Hard to tall from the code you supplied – try pasting the code without commenting out every line. It looks like you are missing the “css file link” in the top by the way.
Use “F12 > Console “in IE to look for error messages.
Alexander
March 6, 2012 at 5:06 pm
I’m attaching the code again here. Everything looks correct to me, but unfortunately it still isn’t working.
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" rel="stylesheet"/> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script> <script type="text/javascript" src="http://office-na.ms.com/ops/operationscontrol/infoctrl/melissa_tests/Shared%20Documents/InlineEditingForSP2007.js"></script> <script type="text/javascript" src="http://office-na.ms.com/ops/operationscontrol/infoctrl/melissa_tests/Shared%20Documents/spjs-utility.js"></script> <script type="text/javascript"> var argObj = {dateFormat:'m/d/yyyy', decimalSeparator:'.', boolYesNoText:'Yes|No', labelArr:['Save','Cancel','Clear'], arrToEdit:['Occurs'], myListGuid:'1f87d67b-189f-402d-8685-cc878a3b6cf4', pinTableHeader:true, hideIdColumn:true}; initCustomEditFunction(argObj); </script>March 6, 2012 at 5:26 pm
Any errors in the F12 > Console?
March 6, 2012 at 5:39 pm
No errors in the F12 console.
March 6, 2012 at 9:32 pm
Hi,
I have tested the latest release with this CEWP code placed BELOW the list view web part in a plain list of type “Custom list”.
Please note that I have linked the scripts from my download location – I recommend you always use local copies.
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" rel="stylesheet" /> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script> <script type="text/javascript" src="http://spjsfiles.com/SharePoint%20JavaScripts/InlineEditingForSP2007/v2.6/InlineEditingForSP2007.js"></script> <script type="text/javascript" src="http://spjsfiles.com/SharePoint%20JavaScripts/spjs-utility/28.02.2012/spjs-utility.js"></script> <script type="text/javascript"> var argObj = {dateFormat:'m/d/yy', decimalSeparator:'.', boolYesNoText:'Yes|No', labelArr:['Save','Cancel','Clear'], arrToEdit:[], myListGuid:ctx.listName, pinTableHeader:true, hideIdColumn:true}; initCustomEditFunction(argObj); </script>You must have the ID column in the view – placed to the far right if you select to hide it – to use this code.
Alexander
March 6, 2012 at 10:49 pm
Hello,
I saved the files locally and referenced them in the code, but again it is just giving me the hover highlight and not the functionality to edit the list items, but this time it is with the updated code versions.
Just as an FYI I have more then one list on my page, but am only using inline for one list. In the list we would like to have the inline functionality for a dropdown, a boolean and a plain text multi-line.
I hope the problem can be identified…I really love this code and am so upset it stopped working on my site.
Thanks again,
Melissa
March 6, 2012 at 11:29 pm
Unfortunately I have no problems in my setup – either with a single list or with multiple lists in one view (note that only one list can have the edit functionality activated)
Is there no changes at all to your setup? – either in the server end or in your browser or anything that could explain why it suddenly stopped working?
If you send me some screenshots I might be able to help.
You could also try to set this up in a view with only one list to see that you can make it work in a “clean environment”.
Alexander
March 7, 2012 at 12:09 am
Thank you so much for taking the time to help me. Nothing was changed on the server side nor in my browser, but I can say that before today I didn’t save the code locally it was being referenced from http://ajax.googleapis.com….
Unfortunately I dont have the capability to provide a screenshot and I already tried to get it to work in a clean environment and it was unsuccessful.
March 7, 2012 at 12:52 am
Just did another debug and the following breaks popped up:
Syntax Error: InlineEditingForSP2007.js, line 2 character 1
The error points to a } in the code
Object expected: line 546 character 6
The error points to initCustomEditFunction(argObj);
March 6, 2012 at 6:57 pm |
Mine also stopped working yesterday. I’m getting an error to use a more recent version of jquery, which I did and now it’s not working at all. Debugger not revealing any breaks.
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" rel="stylesheet" /> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script> <script type="text/javascript" src="http://office-na.ms.com/ops/operationscontrol/infoctrl/rm/java/spjs-utility.js"></script> <script type="text/javascript"> // Set variables var dateFormat = 'm/d/yy'; var boolYesNoText = 'Yes|No'; var arrToEdit = []; myListGuid = ctx.listName; var myListGuid = "{6DF5CA82-2932-47D3-A064-046CA4F87F6C}"; var pinTableHeader = true; var decimalSeparator = '.'; var hideIdColumn = true; initCustomEditFunction(hideIdColumn); </script>March 6, 2012 at 9:26 pm
Hi,
By “stopped working” you mean it stopped working after the update to the latest version – or did it stop working all by it self?
Alexander
March 6, 2012 at 9:27 pm
By the way – you have the wrong CEWP code if you are using the latest version. And you have the variable myListGuid entered two times.
Alexander
March 6, 2012 at 11:56 pm |
Thanks Alexander. I used the newer code. Now the highlights work, but the editing does not.
Debugger says:
‘undefined’ is null or not an object InlineEditingForSP2007.js, line 320 character 2
currVal = (thisItemObj[intName]!==null)?thisItemObj[intName]:”;
March 7, 2012 at 7:17 pm |
Hi Alexander,
Does that error message ring any bells?
Eric
March 7, 2012 at 7:41 pm
If you can provide some screenshots I might be able to help.
Alexander
March 7, 2012 at 7:50 pm
Where can I email a screenshot? Don’t see an attachment option here. The screenshot would only show the error message:
Webpage error details
Message: ‘undefined’ is null or not an object
Line: 314
Char: 2
Code: 0
URI: /…/infoctrl/rm/java/InlineEditingForSP2007.js
March 7, 2012 at 7:59 pm
I need screenshots of the CEWP code, the list view in edit mode and the error message. You find my email in the top of the script file.
Alexander
April 4, 2012 at 9:42 pm
If anybody has a similar issue to what Eric experienced, I noticed that because I downloaded an older version of the spjs-utility (30.11.2011) that a CAML query attempts to pull ID as a Text field as opposed to an Integer. Updating the spjs-utility file to the latest solved this problem for me.
May 12, 2012 at 5:32 pm |
Hi Alexander!
Firstly – thank you for pretty nice and usefull solution.
But I have to state the issue I found – I have a list, where I have a lot of fields, so I have horizontal scroll on page.
The issue is following – is I scroll horizontally closer to the right, at some point I can’t edit any Date&time field -> after click on field I just see flashing dot (which is also you could see at the upper left corner of normal datepicker, when it’s visible) but no datepicker area.
Specific moment here is that the position on scrolling area – it’s certanly has some point, starting from I can’t edit Date&time field – the only point I can connect such behaviour is attachement icon on the header of the list: after I scroll away from it – datepicker unavailable.
I’ve snet you an email with two screenshots, showing the issue.
Hope you will be available to see have a look on the issue and have time for looking into it.
Thank you very much in advance for helping and all your SP stuff!!
May 15, 2012 at 1:09 pm
Got the reason of the issue – if I scroll the page in the way, that I can’t see first letter of list name, on the left side -> then the script stop showing datepicker.
Even if 1 pixel of first letter is visible – script works!
In Firefox works fine! And for all other field issue os not relevant.
May 18, 2012 at 12:23 am
Fixed in v2.6.3.
Alexander
May 15, 2012 at 7:08 am |
One more question on the script, Alexander – how to clear date in datepicker?
Thanks!
May 18, 2012 at 12:24 am
This one has also been fixed in v2.6.3.
Alexander
May 18, 2012 at 6:42 am
Really works! Awesome!!
Thanks a lot, Alexander!
May 24, 2012 at 10:32 pm |
Alexander, one of my users was using your solution and reported positioning issues, so I advised to upgrade to the latest version. One question: does the header scrolling also work in other browsers, for example Chrome?
May 25, 2012 at 11:43 am
Hi Christophe,
It did initially work in IE only, but I have added support for Chrome and Firefox in v2.7.
Alexander
May 25, 2012 at 6:10 pm
That’s very fresh news
Thanks Alexander!
May 25, 2012 at 4:00 pm |
Will this work with sp 2010? Thanks, Ron
May 25, 2012 at 4:02 pm
No, it will not, but in SharePoint 2010 this comes built in. Edit the view to enable it.
Alexander