Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - ronrosell

Pages: [1]
1
Hi Paramvir,

Wrestling with another weird issue. I have two reports on our system, one of which is humming along fine generating reports containing over 100,000 records ... while the other one generates a parsing error at precisely 32,768 records (the limit of an integer).

Here's the error message:
error on line 25 at column 262: xmlParseEntityRef: no name
error on line 25 at column 262: Encoding error

Line 25 is the line that contains our data, which is in a JSON array: [["value","value"...],["value",value"...]] and so on. We're not using objects/labels for this data, just arrays. That's true of both tables ... the one that works, and the one that doesn't.

I'm using the exact same Object definition in the two models. The Column definition is a bit different, but only because the report that's giving me problems has much less data per record ... 9 columns, versus 20.  Moreover, if there were a problem with the column definition I don't think it would be giving me 32767 records without problems.

We're not trying to do any column totals, rendered cells using calculations, or anything like that. Just a table of data, mostly strings, a few dates and a couple of integer values.  This is true of both tables.

I've tried several sets of data, thinking it might be a corrupted record; it always stops at the magic 32,768 integer limit. If I give it 32767 records, the table displays without problems. The problem is also not on the server side; all of the records are being assembled and appearing in the data array in the browser's source code, the browser just isn't parsing it beyond 32,767 records ... except in the "working" model which has no problem with more than 100,000 records.

Any thoughts on what I should be looking for on this? It has to have something to do with that 32,768 integer limit.

Below is the column model, followed by a sample of a couple of records of data.  Thank you!

var colModel = [{
  title: "Trainee ID",
  dataType: "string",
  maxWidth: 100,
  minWidth: 100,
  filter: {
    crules: [{
      condition: 'begin'
    }]
  }
}, {
  title: "Trainee Name",
  dataType: "string",
  maxWidth: 200,
  minWidth: 100,
  filter: {
    crules: [{
      condition: 'begin'
    }]
  }
}, {
  title: "Course ID",
  dataType: "string",
  maxWidth: 100,
  minWidth: 100,
  filter: {
    crules: [{
      condition: 'range'
    }]
  }
}, {
  title: "Course Title",
  dataType: "string",
  filter: {
    crules: [{
      condition: 'range'
    }]
  }
}, {
  title: "Status",
  dataType: "string",
  minWidth: 100,
  maxWidth: 100,
  filter: {
    crules: [{
      condition: 'range'
    }]
  }
}, {
  title: "Score",
  dataType: "integer",
  maxWidth: 70,
  minWidth: 70,
  filter: {
    crules: [{
      condition: 'between'
    }]
  }
}, {
  title: "First Date",
  dataType: "date",
  maxWidth: 100,
  minWidth: 100,
  exportRender: true,
  format: "M dd, yy",
  filter: {
    crules: [{
      condition: 'between'
    }]
  }
}, {
  title: "View Count",
  dataType: "integer",
  maxWidth: 70,
  minWidth: 70,
  filter: {
    crules: [{
      condition: 'between'
    }]
  }
}, {
  title: "Viewing Dates",
  minWidth: 300,
  menuIcon: false,
  dataType: "string"
}];

Here's a snippet of the data.  Note that the string of dates in the last field of each record (spelled out as March 26, 2022 and so on) is not meant to be parsed; those dates all appear as text in one table cell.

var reportdata = [
  ["ba2ead76-cbae-4bd1-ab24-cfb03b9e82ff", "Trainee One", "E_3389", "Lockout/Tagout Affected Employees", "COMPLETED", "90", "03/26/2022", "1", "March 26, 2022"],
  ["47063f83-ca57-4d30-95e6-dbfc95468d25", "Trainee Two", "E_3443", "Dealing With Drug & Alcohol Abuse for Managers", "COMPLETED", "90", "03/25/2022", "3", "March 25, 2022/March 25, 2022/March 25, 2022"]
]

2
Hi Paramvir,

This may be because I've been coding for too long  ;) but I've got a bug that I can't figure out.

Below is the snippet of troublesome code. What I'm doing is letting the user double-click a cell. That sends an Ajax message to the server to toggle the cell's value (active/suspended). The server responds with the new cell contents, and a message displayed elsewhere on the screen.

It all works fine EXCEPT when the table is filtered. Let's say I filter it down to one row. It appears that the row that's being captured on the 4th line (var row = ui.rowIndx) is returning the row number in the filtered array (ie. 0) rather than the overall row number. Later on, in line 14, the cell in the 0 row of the entire table is changed (that is, in the hidden row at the very top of the table). So, while everything gets to the server alright, the wrong cell in the table gets updated by the response.

What I want to do is reference the row that the "clicked" cell is in on the entire, unfiltered table, and update the fourth cell (dataIndx 3) in that row.

I'm guessing I need something different in line 4 or 14, but I'm not sure what.

          if(ui.dataIndx==3){
            var usr = document.getElementById("user").value;
            var com = document.getElementById("co").value;
            var row = ui.rowIndx;
            console.log(row);
            var grid = this;
           $.ajax({
            type: "POST",
            dataType: "json",
            url: "/suspenduser",
            data: {seq:ui.rowData[0],val:ui.rowData[3],user:usr,co:com},
            success: function(data){
            traineelist[row][3]=data.val;
           grid.refreshCell( { rowIndx: row, dataIndx: 3 } );
           $("#message").html(data.message);
           $('#message').show();
           $('#message').fadeOut(3000);
            },
});
        }

Pages: [1]