SharePoint Ecma获取列表属性

时间:2016-02-25 07:16:15

标签: sharepoint sharepoint-2010 sharepoint-2013 ecmascript-5 ecma

我正在尝试使用SharePoint ECMA读取列表属性但无法成功。

任何人都可以提供帮助 - 这是代码 - 尝试使用方法get_fieldValues和get_item并且两者都返回" undefined"。

var key = "vti_level";
function getListProperty() {
    var clientContext = new SP.ClientContext();
    var listGuid = GetUrlKeyValue('List', window.location.href);
    this.props = clientContext.get_web().get_lists().getById(listGuid).get_rootFolder();
    clientContext.load(this.props);
    clientContext.executeQueryAsync(Function.createDelegate(this, getListPropertySuccess), Function.createDelegate(this, getListPropertyFailed));
}

function getListPropertySuccess() {
    var propKey1 = this.props.get_properties().get_fieldValues()[key];
    var propKey2 = this.props.get_properties().get_item(key);
}

function getListPropertyFailed() {
    alert('Request failed on getListProperty.');
}

1 个答案:

答案 0 :(得分:1)

试试这个:

class MyNewBaseClass
{
public:
  int m_nVar;

protected:
  virtual void MyFunc()
     {
       m_nVar++;
     }
 public:
   MyNewBaseClass()
    {
    }
};

class MyBaseClass : public MyNewBaseClass
{
 public:
   MyBaseClass()
    {
      m_nVar = 1;
    }
};

class MyDerivedClass : public MyBaseClass
{
public:
   int m_nVar;//this causes me problems, I need to get notifications on occurrences of such situations 
 public:
   MyDerivedClass ()
    {
      m_nVar = 2; //this assignments has no effect on MyNewBaseClass::m_nVar
    }
};
相关问题