For a development i need to get the current view in a library. I added a content editor webpart on allitems.aspx that links to a js file. inside i have to get the current view id. I can have listid but viewid is always null
Here is how i do
var context = SP.ClientContext.get_current();
var web = context.get_web();
var listID = SP.ListOperation.Selection.getSelectedList();
console.log("listID="+listID);
var viewID = SP.ListOperation.ViewOperation.getSelectedView();
console.log("listID ="+viewID );//here is null
I've searched in google without succes
Thanks for your help