zoukankan      html  css  js  c++  java
  • SPServices Document Library 查询某个文档

    使用jquery.SPServices查询文档库里的某一个文档,需要设置CAMLQueryOptions属性,<ViewAttributes Scope="RecursiveAll" />才能查询出来,取值的时候需要使用SPFilterNode("z:row")

            $().SPServices({
                operation: "GetListItems",
                async: false,
                listName: "Test Documents",
                CAMLQuery: "<Query><Where><Eq><FieldRef Name='ID' /><Value Type='Counter'>" +strID+ "</Value></Eq></Where></Query>",
                CAMLQueryOptions:'<QueryOptions><ViewAttributes Scope="RecursiveAll" /></QueryOptions>',
                CAMLRowLimit: 1,
                CAMLViewFields: "<ViewFields><FieldRef Name='YourField' /><FieldRef Name='ID' /></ViewFields>",
                completefunc: function(xData, Status) {
                    $(xData.responseXML).SPFilterNode("z:row").each(function(i) {
                        if($(this).attr("ows_YourField")!='' && $(this).attr("ows_YourField") != null && $(this).attr("ows_YourField") != 'undefined'){
                            YourField = $(this).attr("ows_YourField");
                        }
                    });
                }
            });
  • 相关阅读:
    3月30日
    3月29日
    3月26日
    3月24
    3月22日
    3月20日
    博弈论基础
    $burnside$引理与$pacute olya$定理
    min-max容斥
    模板
  • 原文地址:https://www.cnblogs.com/bmib/p/2514876.html
Copyright © 2011-2022 走看看