tolims filter, pagination

This commit is contained in:
2026-03-29 17:13:54 +03:00
parent 3e66d67dc5
commit c573a46318
7 changed files with 768 additions and 57 deletions
+12 -2
View File
@@ -164,10 +164,12 @@
const templateId = window.gridMeta?.templateId;
if (!templateId) { alert('Template ID missing'); return; }
const urlParams = new URLSearchParams(window.location.search);
const importref = urlParams.get('importref') || '';
const resp = await fetch('add_record.php', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ template_id: templateId })
body: JSON.stringify({ template_id: templateId, importreferencecode: importref })
});
const result = await resp.json();
@@ -186,7 +188,7 @@
fixedFields: {},
details: {},
mainFieldValue: '',
_dirty: true,
_dirty: false,
};
// Add to beginning of gridData
@@ -195,6 +197,14 @@
// Re-render
const gr = window.gridRenderer;
if (gr) gr.renderVisibleRows();
// Highlight new row briefly
const newGridRow = document.querySelector(`.grid-row[data-id="${result.iddatadb}"]`);
if (newGridRow) {
newGridRow.classList.add('row-just-created');
newGridRow.scrollIntoView({ behavior: 'smooth', block: 'center' });
setTimeout(() => newGridRow.classList.remove('row-just-created'), 4000);
}
} else {
alert('Error: ' + (result.message || 'Unknown error'));
}