4,129 reputation
2923
bio website
location Norway
age 28
visits member for 4 years, 9 months
seen 1 hour ago

Nov
14
comment How to get deferred object for sharepoint rest queries
Sounds like you want to use $.ajax({async:false}) and drop promises. While that is possible, IMHO it's a bad idea. Returning a promise is a good thing, even if it adds some lines to the library usage. E.g., what would you do if you wanted to bundle several requests and wait for all of them to finish? With a promise that is superdupereasy
Nov
14
comment How to get deferred object for sharepoint rest queries
The object you get back is the promise, not the data. It's not synchronous, so you would do something like RESTQueries.readItemsFromList().then(function(data) { console.log(data); });
Nov
13
comment SharePoint 2013 REST how to add pagination?
@MehdiJalal the explanation above should be a sufficient starting point IMHO, after all you might want to implement this in smart-table, ng-grid, ngtable or the other pals and so the code would be quite different. However I will oblige and spoon-feed you as soon as I get home from work in some hours
Nov
13
comment SharePoint 2013 REST how to add pagination?
I don't think $skip works @pholpar, my example above does, it's how I do it on SharePoint online at least (just look at _next when you query /Items).
Nov
6
comment Automatic Bootstrap Tabs in SharePoint
If you can stick with one version of jQuery that is the best. I'll just copy/move my top comment to question in order to snag a point.
Nov
6
comment Automatic Bootstrap Tabs in SharePoint
There are several ways, you might be able to use jQuery.noConflict. When it comes to SharePoint I usually just use requirejs (or browserify), although that might be a bit much
Nov
6
comment Automatic Bootstrap Tabs in SharePoint
That means jQuery.fn.tab is undefined, which means the jQuery version you are working on does not have Bootstrap tabs appended to it. This could be the result of many things, such as not including the bootstrap script, or order of scripts, or having several versions of jQuery on the same page
Nov
5
comment URL field in sharepoint : Points to Control Template when http removed
The most simple straight forward answer would be to just do something like this with UriBuilder. But I suspect you have thought about this since you ask?
Nov
5
comment Transfer times for REST API queries vary a lot
I just have to ask; why would REST need more round trips than JSOM? In the example query by OP there is one single query for items, and this can be made smaller by using $select. If additional data is needed $expand will give much the same stuff as JSOM without additional request. I would say it is the contrary, the JSON response from REST can be smaller than the bloated one from JSOM
Nov
3
comment How to trim down date to example 2014-10-10?
getMonth() starts at 0, for the fun of it. Just do ` + (d.getMonth() + 1) + ...`. Note the parentheses here, they are important.
Nov
3
comment How to trim down date to example 2014-10-10?
Have you tried moment.js ?
Nov
1
comment Combine REST query “GetItems” action with OData $filter parameter
@John-o I probably misunderstood a bit. Using only CAML is what I do today, I combine view query with my own custom query (see my answer below). I thought Vadim meant to not use view query but just make my own CAML from ground up. This is the most correct answer then :)
Oct
30
comment Combine REST query “GetItems” action with OData $filter parameter
Sorry but this doesn't answer my question. I know I can rewrite CAML to $filter, but I don't have any tool to magically convert ViewQuery to $filter. Note that, as I said, $top actually works, no need to "convert" that. I'm very tempted to upvote just because you say that query can be moved to POST data instead of querystring, which is very important, but it's more a comment than an answer IMHO.
Oct
30
comment Error from javascript file but not console?
Your code should work, but I'll just note this: No need to use new keyword when you call get_current()
Oct
30
comment SharePoint 2013 REST display Rich Text field not working?
The last div there should be fine, as long as you include ngSanitize and add it as a module. If it does not work check your console (web dev tools) for errors
Oct
30
comment SharePoint 2013 REST display Rich Text field not working?
It should work if you copy my example above. Note that Angular version can be important, make sure you have the latest
Oct
30
comment SharePoint 2013 REST display Rich Text field not working?
Don't do both ng-bind-html and {{customer.Content}}, only do the attribute
Oct
30
comment Combine REST query “GetItems” action with OData $filter parameter
I should definitely be mixing CAML and OData. My example code let you query a list based on a view, in my experience users often wants data from their views. Imagine the possibilities if you could mix the users list view with your own custom filtering
Oct
22
comment Do check out in a document with jquery
@JohnColtrane The example code above will not print any errors. Check your network log (e.g., Chrome dev tools and Network-tab, then check the response body). Or add .error(function(){console.log(arguments)})
Oct
14
comment CRUD Tasks using Javascript via REST OData
There is most likely a error message, which you can print to console or similar. If you use say Chrome you can view the response body in Network-tab (dev tools)