@@ -382,6 +382,7 @@ class DataHarmonizer {
382382 colHeaders : true ,
383383 rowHeaders : true ,
384384 renderallrows : false , // working?
385+ outsideClickDeselects : false , // TESTING
385386 manualRowMove : true ,
386387 multiColumnSorting : {
387388 sortEmptyCells : true ,
@@ -836,7 +837,7 @@ class DataHarmonizer {
836837 && row2 === self . current_selection [ 2 ]
837838 && column2 === self . current_selection [ 3 ]
838839 ) {
839- console . log ( 'Double event: afterSelectionEnd' )
840+ console . log ( 'Double event: afterSelectionEnd' , row , column , row2 , column2 , selectionLayerLevel , action )
840841 return false
841842 }
842843 // ORDER IS IMPORTANT HERE. Must calculate row_change, column_change,
@@ -959,10 +960,11 @@ class DataHarmonizer {
959960 let translatable = '' ;
960961 for ( var column_name of text_columns ) {
961962
962- // Exception is 'permissible_values', 'text' where in default
963+ // DEPRECATED: Exception is 'permissible_values', 'text' where in default
963964 // schema there might not be a title. find 'text' instead of 'title'
964- if ( sub_part === 'permissible_values' && column_name === 'title' )
965- column_name = 'text' ;
965+ // NOW INSIST ON "text" column for all schemas
966+ //if (sub_part === 'permissible_values' && column_name === 'title')
967+ // column_name = 'text';
966968 let col = tab_dh . slot_name_to_column [ column_name ] ;
967969 let text = tab_dh . hot . getDataAtCell ( row , col , 'lookup' ) || '' ;
968970 default_row_text += `<td>${ text } </td>` ;
@@ -975,6 +977,10 @@ class DataHarmonizer {
975977 let key2 = null ;
976978 if ( sub_part_key_name ) {
977979 key2 = tab_dh . hot . getDataAtCell ( row , tab_dh . slot_name_to_column [ sub_part_key_name ] , 'lookup' ) ;
980+ if ( ! key2 ) {
981+ console . log ( "key2" , key2 , "lookup from" , TRANSLATABLE [ tab_dh . template_name ] ) ;
982+ alert ( "unable to get key2 from lookup of:" + sub_part_key_name )
983+ }
978984 }
979985
980986 // DISPLAY locale for each schema in_language menu item
@@ -1156,7 +1162,7 @@ class DataHarmonizer {
11561162 if ( focus_row < 0 )
11571163 focus_row = 0 ;
11581164 }
1159-
1165+
11601166 // Find an empty row
11611167 if ( ! focus_cell ) {
11621168 for ( focus_row = 0 ; focus_row < this . hot . countRows ( ) ; focus_row ++ ) {
@@ -1227,7 +1233,7 @@ class DataHarmonizer {
12271233 case 'imports' :
12281234 value = this . getDelimitedString ( schema . imports ) ;
12291235 break ;
1230-
1236+
12311237 default :
12321238 value = schema [ dep_slot . name ] ??= '' ;
12331239 }
@@ -2185,7 +2191,9 @@ class DataHarmonizer {
21852191 addRows ( row_where , numRows , startRowIndex = false ) {
21862192 numRows = parseInt ( numRows ) ; // Coming from form string input.
21872193 // Get the starting row index where the new rows will be added
2188- if ( startRowIndex === false ) startRowIndex = this . hot . countSourceRows ( ) ;
2194+ // ISSUE HERE IS THAT VISUAL ROW doesn't CORRESPOND TO
2195+ if ( startRowIndex === false )
2196+ startRowIndex = this . hot . countSourceRows ( ) ;
21892197
21902198 let parents = this . context . crudGetParents ( this . template_name ) ;
21912199 // If this has no foreign key parent table(s) then go ahead and add x rows.
@@ -2207,7 +2215,8 @@ class DataHarmonizer {
22072215 return ;
22082216 }
22092217
2210- this . hot . alter ( row_where , startRowIndex , numRows ) ;
2218+ // NEW ROWS ARE ADDED HERE.
2219+ //this.hot.alter(row_where, startRowIndex, numRows);
22112220
22122221 // Populate new rows with selected foreign key value(s)
22132222 // "add_row" is critical so we can ignore that in before_change event.
0 commit comments