Is there a possibility to access the ListItem.Properties
from the Javascript COM? All I'm seeing is the possibility to read all Fields
. There also is the funny [SP.ListItem.LoadExpandoFields()][1]
, but I don't know what it does.
-
I believe you can access this by soap so you would be looking at accessing the soap api via JQuery, failing that make your own handler and call that.– Hugh WoodAug 21, 2012 at 18:52
-
With soap you mean the SP webservices?– Dennis GAug 21, 2012 at 19:27
Add a comment
|
1 Answer
You could try:
item.get_fieldValues().MetaInfo
Full example (with ES5):
var listTitle = 'TestList', itemId = 1;
var ctx = new SP.ClientContext();
var item = ctx.get_web().get_lists().getByTitle(listTitle).getItemById(itemId);
ctx.load(item);
ctx.executeQueryAsync(function() {
var properties = item.get_fieldValues().MetaInfo.trim();
properties = properties.split(/\n/).filter(function(p) {
return !!p;
}).map(function(p) {
p = p.split(/\|/);
var t = p[0].split(/:/);
return {
name: t[0],
type: t[1],
value: p[1]
};
});
console.log(properties);
});
-
Nice! SharePoint 2013 will make our lives easier, but this is neat. Didn't know MetaInfo contained all properties.– Dennis GNov 11, 2012 at 15:31
-
1Me neither actually. What I did was to inspect the payload sent from server to see if my properties were actually sent at all. Then I noticed that they were contained in
MetaInfo
.– eirikbNov 11, 2012 at 16:29