如何使用SPServices - GetListItems从查找字段中获取格式化值?

时间:2016-06-01 15:08:48

标签: sharepoint-2010 spservices

当我使用SPServices - GetListItems(下面的代码)从列表中读取查找字段时,返回的值始终位于标准 ID; #Value 上,但我只需要该值。

如何从查询字段中获取格式化值(仅ID或仅值)?

  function GetListItems(itemId) {
      var query = "<Query>" +
                "<Where>" +
                    "<Eq>" +
                        "<FieldRef Name='ID' />" +
                        "<Value Type='Counter'>" + itemId + "</Value>" +
                    "</Eq>" +
                "</Where>" +
            "</Query>";

    $().SPServices({
        operation: "GetListItems",
        async: true,
        listName: "MyList",
        CAMLRowLimit: 1,
        CAMLQuery: query,
        completefunc: function (xData, Status) {
            $(xData.responseXML).SPFilterNode("z:row").each(function () {
                alert($(this).attr("ows_LookupField"));
            });
        }
    });

1 个答案:

答案 0 :(得分:0)

split method将字符串分解为数组中的子字符串。

#Code to get all ADUsers and sort them | Where-Object { $source = "PATH HERE" + $_.number + ".jpg" } | ForEach-Object { # do something }