This is a migrated thread and some comments may be shown as answers.

Grid stopped updating

2 Answers 56 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Brett
Top achievements
Rank 1
Brett asked on 02 Apr 2019, 08:25 PM

Hi,

I'm using Node.js configured with DataSource. All was working fine. We switched from mysql to Postgres and now the Grids don't populate with the returned data. Before pasting tons of code here, checking if I missed something obvious:

I added the following change event function to the transport, and in the Chrome debugger I see the expected rows are returned in the results. What I don't know if the data object stores the rows in some new or unexpected way. There's an element called "0" with child array called "rows" which has the correct number of rows, populated with the correct data and elements named correctly. I also checked the element names throughout and they match. 

Any tips on how to debug whether the grid is receiving the update?

change: function(e) {
    var data = this.data();
    console.log(data);
}

2 Answers, 1 is accepted

Sort by
0
Brett
Top achievements
Rank 1
answered on 02 Apr 2019, 08:36 PM

I added the following to the grid and set a breakpoint on it. In the debugger I see e.items[0].rows has the correct data in it so seems like it's receiving as e.action = "rebind". But the grid itself is empty (has no rows).

dataBinding: function(e) {
console.log("dataBinding");
},

0
Brett
Top achievements
Rank 1
answered on 02 Apr 2019, 09:05 PM

Answering myself in case it helps somebody else:

The results returned by Postgres were buried one deep compared to mysql, so instead of returning "results" directly I returned results.rows. 

Tags
Data Source
Asked by
Brett
Top achievements
Rank 1
Answers by
Brett
Top achievements
Rank 1
Share this question
or