jQuery Library for SharePoint Web Services v0.4.6 Released
Today I released v0.4.6 of my jQuery Library for SharePoint Web Services. This version was fun to work on because I’ve got quite a few people out there in the world (California, North Carolina, Sweden) using the library actively, so we were able to work together pretty much real time to get enhancements and bug fixes into the library together. This was also the first release where I decided to keep a current alpha version posted on Codeplex while I was doing the work. This was rewarding because there was a real feedback loop going on. I think this is a better way to go in the future, so watch for more alpha versions you can kick the tires on for me (actually for all of us).
This release has two really nice enhancements:
- SPCascadeDropdowns now works with multi-select child columns. This was the most requested enhancements over the last few months, and to be honest I dragged my feet on it. The controls that SharePoint uses for multi-select choices are just plain complicated. There’s also a whole pile of JavaScript which sites behind it all (groupeditempicker.js) that took some time to dig through. The good news is that I was able to take advantage of those “native” JavaScript functions and write less of my own code.
- Both SPCascadeDropdowns and SPDisplayRelatedInfo now have a new CAMLQuery option which allows you to specify additional filters on the relationshipList. You specify this as an additional CAML fragment which is then <And>ed with the filters which the library uses to grab the allowable values. For example, the CAMLQuery option can contain a CAML fragment like:
CAMLQuery: "<Gt><FieldRef Name='ID'/><Value Type='Counter'>1</Value></Gt>"
or
CAMLQuery: "<Eq><FieldRef Name='Status'/><Value Type='Text'>Active</Value></Eq>"
Additionally, the $().SPServices.SPCascadeDropdowns and $().SPServices.SPSPDisplayRelatedInfo functions are now *much* more efficient. As part of the refactoring I did in v0.4.5, there were some unnecessary Web Services calls happening. With this efficiency change, there are no unneeded calls, so the dropdowns ought to behave almost as fast as they would without the functions sitting behind them.Of course there are some bug fixes as well.
Release NotesNew Functionality
New Operations
Bug Fixes and Efficiency
|
I’ve tried the SPRedirectWithID function. It seems that it could not work with Sharepoint 2010. Any plan for this library also work with Sharepoint 2010?
I don’t have a solid plan at this point for SharePoint 2010 with the library. I know that some of the functions won’t really be necessary (because there is analogous functionality in 2010), but the basic Web Services stuff should work the same.
You’re the first person who’s asked other than hypothetically!
M.
How can I redirect the NewForm.aspx to DispForm.aspx?ID=nnn where nnn is the list ID of the new item in Sharepoint 2010?
Winson:
I haven’t done any testing of my library with SharePoint 2010 yet. It’s possible that the $().SPServices.SPRedirectWithID function will work, but I’m guessing it won’t as there are bound to have been some changes to the page structures that the function uses. Give it a try and let me know whether it works or not!
M.
Hi,
I have change the SPRedirectWithID like this:
if(vals[“ID”] == undefined) {
…
newID = parseInt(lastID) + 1;
newID = newID + ‘ ‘; // it will go to next item ID & change the newID as String
…
$().find(“form[name=’aspnetForm’]”).each(function() {
var SPurl = location.href.substring(0,location.href.lastIndexOf(“/”));
…
var thisRedirectUrl = (typeof vals[“RedirectURL”] == “string”) ? vals[“RedirectURL”] : opt.redirectUrl;
var newAction = SPurl + “/” + thisRedirectUrl + “?ID=” + newID;
$(this).attr(“action”, newAction);
…
The original url: http://servername/Lists/listname/newform.aspx
The newAction will become: http://servername/Lists/listname/RedirectURL?ID=newID
However, the aspnetForm action does not work in SP2010! Please Help! The last sentence does not work (change the action attribute).
The SPGetLastItemID function has following problem:
If all the list item had been removed, the SPGetLastItemID will return value of “1” which is not the actual last item ID!
Winson:
Looks like you are getting there. As I said, I haven’t done *ANY* testing with SharePoint 2010, so you’re on your own there for now, though I plan to look at it sometime.
It’s not enough to just add 1 to the “lastID”. Others could be adding items in the interim. Also, I’m not sure how all items could have been removed when your user will have just committed one. You want to use the ID for that last committed item by this user, which is what I’m using the Web Services to find.
I’d appreciate it if you could post your findings on the Codeplex site Discussions so that I can track against it there. It will help me when I get to the point of testing (and probably reconfiguring) this for SharePoint 2010.
M.
thank you Marc for the effort