To Get the Total Number of items from the custom list which satisfy our caml query, the code is as below :
var queryText = "<Query><Where><Eq><FieldRef Name='OfficeType' /><Value Type='Lookup'>"+OfficeType+"</Value></Eq></Where></Query>";
$().SPServices({
operation: "GetListItems",
listName: "FacilityStatus",
async: false,
CAMLQuery: queryText,
completefunc: function (xData, status) {
itemCount = $(xData.responseXML).SPFilterNode("rs:data").attr("ItemCount");
}
});
return itemCount ;
}
var queryText = "<Query><Where><Eq><FieldRef Name='OfficeType' /><Value Type='Lookup'>"+OfficeType+"</Value></Eq></Where></Query>";
$().SPServices({
operation: "GetListItems",
listName: "FacilityStatus",
async: false,
CAMLQuery: queryText,
completefunc: function (xData, status) {
itemCount = $(xData.responseXML).SPFilterNode("rs:data").attr("ItemCount");
}
});
return itemCount ;
}
No comments:
Post a Comment