You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(#18): viewport jumping/rendering issue on large values
moves editor into new window to prevent datalose on focus switch
Value cell inline editor replaced with dialog bases input (#18)
some commands have been removed since those cant work with the new window bases approch (todo)
@@ -306,7 +316,13 @@ async function onDOMContentLoaded() {
306
316
307
317
table=newTabulator("#mainTable",{
308
318
autoColumns: true,
309
-
height: "460px",
319
+
/*height: "460px",*/
320
+
//virtualDomBuffer:99999, //set virtual DOM buffer to 300px
321
+
//renderVertical:"basic", //disable virtual DOM rendering
322
+
//virtualDom:false, // also disable virtual DOM rending ??? wtf
323
+
height: "100%",
324
+
maxHeight: "100%",
325
+
virtualDom: false,
310
326
placeholder: "No items found",
311
327
layout: "fitDataStretch",
312
328
pagination: false,
@@ -409,14 +425,14 @@ async function onDOMContentLoaded() {
409
425
field: "value",
410
426
headerFilter: "input",
411
427
headerFilterPlaceholder: "Filter",
412
-
editor: "textarea",
428
+
/*editor: "textarea",
413
429
editorParams: {
414
430
elementAttributes: {
415
431
spellcheck: "false",
416
432
},
417
433
verticalNavigation: "editor",
418
434
shiftEnterSubmit: true,
419
-
},
435
+
},*/
420
436
formatter: "plaintext",
421
437
},
422
438
],
@@ -463,6 +479,39 @@ async function onDOMContentLoaded() {
463
479
}
464
480
*/
465
481
});
482
+
483
+
table.on("cellClick",function(e,cell){
484
+
//e - the click event object
485
+
//cell - cell component
486
+
//e - the click event object
487
+
//row - row component
488
+
constfield=cell.getField();
489
+
490
+
if(field==="value"){
491
+
editorTempCell=cell;
492
+
constrowData=cell.getRow().getData();
493
+
textareaEl.value=rowData.value;
494
+
selectEl.value=rowData.store;
495
+
inputEl.value=rowData.key;
496
+
editDialog.showModal();
497
+
textareaEl.focus();
498
+
}
499
+
});
500
+
501
+
// "Cancel" button closes the dialog without submitting because of [formmethod="dialog"], triggering a close event.
502
+
/*
503
+
editDialog.addEventListener("close", (e) => {
504
+
//if(editDialog.returnValue !== "default")
505
+
//console.debug(editDialog.returnValue);
506
+
});
507
+
*/
508
+
509
+
// Prevent the "confirm" button from the default behavior of submitting the form, and close the dialog with the `close()` method, which triggers the "close" event.
510
+
confirmBtn.addEventListener("click",(event)=>{
511
+
event.preventDefault();// We don't want to submit this fake form
512
+
editorTempCell.setValue(textareaEl.value,true);
513
+
editDialog.close();// Have to send the select box value here.
0 commit comments