sympmarc / SPServices

SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install.
MIT License
208 stars 61 forks source link

Fixed bug with textareas #14

Closed iOnline247 closed 8 years ago

iOnline247 commented 9 years ago

This find the comment nodes and only checks the comment nodes, not the full HTML. I found a bug with the previous method in that it would return the incorrect td if a textarea had a value of FieldName="ColumnName". This new function also allows usage of the static name.

http://jsfiddle.net/iOnline247/zfdLq4cw/

sympmarc commented 8 years ago

@iOnline247 : We're now working on SPServices 2.0. If you'd like to resubmit this pull request against the current code base, I'll look at it again. Sorry I never got to it before.

iOnline247 commented 8 years ago

The testbed is still online if you want to pull it in. http://jsfiddle.net/iOnline247/zfdLq4cw/

It's a drop in replacement of the function that caused a problem for me: https://github.com/sympmarc/SPServices/blob/master/dist/jquery.SPServices.js#L4460-L4474

sympmarc commented 8 years ago

So the goal here is to allow for searching on the DisplayName or StaticName?

sympmarc commented 8 years ago

Oh, ok. I see what you're doing. I'm finding a match if the text 'FieldName="ColumnName"' is the column's elements anywhere. Sort of an edge case, but I get it.

The danger in matching on both the DisplayName or StaticName is that sometimes columns get renamed enough to cause issues. For instance, We could have a column with the DisplayName "Location" and a column with the StaticName "Location", right?

iOnline247 commented 8 years ago

It could be looked at as a feature, especially for people that are just starting out. If that's too big of a drawback, that capability could be easily removed. I had both for others and just documented the drawbacks of DisplayName usage.