简体   繁体   中英

SPServices Unique choice field not giving list entry

This one may sound weird but any help would be greatly appreciated.

I'm using GetListItems of SPServices and one of the fields is a Choice field that has to be unique (which I believe is causing the issue). Here is the code:

$().SPServices({
      operation: method, 
      async: false,
      listName: "Content", 
      CAMLViewFields: "<ViewFields><FieldRef Name='Title' /><FieldRef Name='Section' /><FieldRef Name='Content' /><FieldRef Name='Order' /></ViewFields>", 
      CAMLQuery: "<Query><OrderBy><FieldRef Name='Order' Ascending='True'/></OrderBy><Where><Neq><FieldRef Name='ID' /><Value Type='Number'>0</Value></Neq></Where></Query>",
      completefunc: function (xData, Status) { 
           $(xData.responseXML).SPFilterNode("z:row").each(function() {
                var cont = $(this).attr('ows_Content')==undefined?cont = "": cont = $(this).attr('ows_Content');
                var object={
                     title:$(this).attr('ows_Title'),
                     content:cont,
                     order:$(this).attr('ows_Order')
                }
                pages.push(object);
                console.log(object.order)
           });
      }
 });

The console log details the object.order as:

"100.000000000000"
"200.000000000000"
"300.000000000000"
etc...

At first I thought It was just pulling through a float error but I could get around that until I noticed that the order choice in the list does not match the selection.

For Example, the list item which order is 1 (in the List View), on the page pulls through as order 200.000000000000

Im not sure why this is, can anyone help?

好的,这样就找到了我想要的值,因为事实证明存在一个名为ows_Order0的辅助属性,其中包含选定的值。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM