@@ -127,7 +127,7 @@ function initializeView() {
127
127
const scrollToLastRowButton = document . getElementById ( 'scroll-to-last-row-button' ) ;
128
128
scrollToLastRowButton . addEventListener ( 'click' , scrollToLastRow ) ;
129
129
130
- // notify webview
130
+ // request initial rows data load
131
131
vscode . postMessage ( { command : 'refresh' } ) ;
132
132
}
133
133
@@ -223,16 +223,15 @@ function onTableBuilt () {
223
223
console . log ( 'tableView.columns:' , columns ) ;
224
224
225
225
// add row selection column
226
+ // TODO: make this optional via tabular data viewer config setting
226
227
table . addColumn ( {
227
228
formatter : 'rowSelection' ,
228
229
titleFormatter : 'rowSelection' ,
229
230
headerMenu : [ ] , // don't show header context menu
230
231
headerSort : false ,
231
232
download : false // don't include it in data save
232
233
} , true ) // add as 1st column
233
- . then ( function ( column ) {
234
- // column - the component for the newly created column
235
- // run code after column has been added
234
+ . then ( function ( column ) { // column - row selection colulmn component
236
235
} )
237
236
. catch ( function ( error ) {
238
237
// log adding row selection column error for now
@@ -324,19 +323,20 @@ function clearTable(table) {
324
323
}
325
324
326
325
/**
327
- * Adds data to the table.
326
+ * Adds data rows to the table.
328
327
*
329
328
* @param {* } table Tabulator table instance.
330
- * @param {* } tableData Data array for the table rows.
329
+ * @param {* } dataRows Data array for the table rows to add .
331
330
*/
332
- function addData ( table , tableData ) {
333
- if ( table && tableData ) {
334
- table . addData ( tableData , true )
331
+ function addData ( table , dataRows ) {
332
+ if ( table && dataRows ) {
333
+ table . addData ( dataRows , true )
335
334
. then ( function ( rows ) { // rows - array of the row components for the rows updated or added
336
- // update loaded rows counter
335
+ // update loaded table data array and rows counter
336
+ tableData . push ( dataRows . shift ( ) ) ;
337
337
loadedRows += rows . length ;
338
338
if ( loadedRows < totalRows ) {
339
- // request more data to load and display
339
+ // request more data rows to load and display
340
340
dataPage ++ ;
341
341
progressRing . style . visibility = 'visible' ;
342
342
vscode . postMessage ( {
0 commit comments