javascript array, spservices, does not match known number of columns

javascript array, spservices, does not match known number of columns

johnbeatlejohnbeatle Posts: 3Questions: 0Answers: 0
edited December 2010 in General
This is my first time using datatables, so I apologize if this turns out to be something obvious. Can't seem to get this working. I figure it has got to be the way I am building the datatable paramenters. Any help would be much appreciated. The error I get is "Datatables warning (table id 'tblFeatures'): Added data (size 851) does not match known number of columns."

[code]
$(document).ready(function() {
var myTitle;
var tmpArr;
myHeaderRow = "{ \"sTitle\": \"Organization\" }";

$().SPServices({
operation: "GetListItems",
listName: "Features",
async: false,
CAMLViewFields: "",
CAMLQuery: "16",
completefunc: function (xData, Status) {
$(xData.responseXML).find("[nodeName=z:row]").each(function() {
myTitle = $(this).attr("ows_Title");
arrAppFeats.push(myTitle);
myHeaderRow += ", { \"sTitle\": \"" + myTitle + "\" }";
});
}
});

$().SPServices({
operation: "GetListItems",
listName: "Organization",
async: false,
CAMLViewFields: "",
completefunc: function (xData, Status) {
$(xData.responseXML).find("[nodeName=z:row]").each(function() {
//alert(xData.responseXML.xml);
orgName = $(this).attr("ows_Abbr");

myDataRow += "[ \"" + orgName + "\"";
colMatch = "false";

$().SPServices({
operation: "GetListItems",
listName: "Feature Rank",
async: false,
CAMLViewFields: "",
CAMLQuery: "" + orgName + "",
completefunc: function (xData, Status) {
for (i=0;i

Replies

  • johnbeatlejohnbeatle Posts: 3Questions: 0Answers: 0
    I ended up getting it after some research....

    [code]

    var webroot = $().SPServices.SPGetCurrentSite();
    var orgName;
    var arrAppFeats = new Array();
    var colMatch;
    var fieldValue;
    var obj;
    var aoColumns = [];
    var aoRows = [];
    var myTitle;

    $(document).ready(function() {
    aoRows = new Array();
    aoColumns = new Array();

    obj = new Object();
    obj.sTitle = "Organization";
    obj.sClass = "center";
    aoColumns.push(obj);

    $().SPServices({
    operation: "GetListItems",
    listName: "Features",
    async: false,
    CAMLViewFields: "",
    CAMLQuery: "16",
    completefunc: function (xData, Status) {
    $(xData.responseXML).find("[nodeName=z:row]").each(function() {
    myTitle = $(this).attr("ows_Title");
    arrAppFeats.push(myTitle);
    obj = new Object();
    obj.sTitle = myTitle;
    obj.sClass = "center";
    aoColumns.push(obj);
    });
    }
    });

    var arrItems;

    $().SPServices({
    operation: "GetListItems",
    listName: "Organization",
    async: false,
    CAMLViewFields: "",
    completefunc: function (xData, Status) {
    //alert(xData.responseXML.xml);
    $(xData.responseXML).find("[nodeName=z:row]").each(function() {
    arrItems = new Array();
    orgName = $(this).attr("ows_Abbr");
    arrItems.push(orgName);
    colMatch = "false";

    $().SPServices({
    operation: "GetListItems",
    listName: "Feature Rank",
    async: false,
    CAMLViewFields: "",
    CAMLQuery: "" + orgName + "",
    completefunc: function (xData, Status) {
    for (i=0;i
This discussion has been closed.