เพื่อการส่งออกตารางทั้งหมดอย่างรวดเร็ว ฉันได้เพิ่มโค้ดบางส่วนเพื่อใช้งานปุ่ม "ส่งออก"
droptables เพิ่มสิ่งเหล่านี้ลงในเวอร์ชันอย่างเป็นทางการถัดไป
ไฟล์ที่แก้ไข: /modern/admin/tmpl/droptables/default.php เพื่อเพิ่ม
ปุ่ม "ส่งออกทั้งหมด":
สคริปต์
// เพิ่มฟังก์ชันส่งออกตารางทั้งหมด
jQuery(document).ready(function ($) {
$('#export_all').on('click', function(e) {
e.preventDefault();
// รับ ID ตารางทั้งหมดจากมุมมองปัจจุบัน
var tableIds = [];
var base_export_url = " index.php?option=com_ droptables &task=excel.export&format_excel=xlsx&front=0&onlydata=1&id=";
if ( Droptables .listTable) {
for (var catID in Droptables .listTable) {
if ( Droptables .listTable.hasOwnProperty(catID)) {
if (typeof Droptables .listTable[catID] !== 'undefined' && Droptables .listTable[catID].length > 0) {
Droptables .listTable[catID].forEach(function(table) {
tableIds.push(table.id);
window.open(base_export_url + table.id, '_blank');
});
}
}
}
console.log('Table IDs:', tableIds);
} else {
console.log('No tables found');
}
return false;
droptables เพิ่มสิ่งเหล่านี้ลงในเวอร์ชันอย่างเป็นทางการถัดไป
ไฟล์ที่แก้ไข: /modern/admin/tmpl/droptables/default.php เพื่อเพิ่ม
ปุ่ม "ส่งออกทั้งหมด":
สคริปต์
// เพิ่มฟังก์ชันส่งออกตารางทั้งหมด
jQuery(document).ready(function ($) {
$('#export_all').on('click', function(e) {
e.preventDefault();
// รับ ID ตารางทั้งหมดจากมุมมองปัจจุบัน
var tableIds = [];
var base_export_url = " index.php?option=com_ droptables &task=excel.export&format_excel=xlsx&front=0&onlydata=1&id=";
if ( Droptables .listTable) {
for (var catID in Droptables .listTable) {
if ( Droptables .listTable.hasOwnProperty(catID)) {
if (typeof Droptables .listTable[catID] !== 'undefined' && Droptables .listTable[catID].length > 0) {
Droptables .listTable[catID].forEach(function(table) {
tableIds.push(table.id);
window.open(base_export_url + table.id, '_blank');
});
}
}
}
console.log('Table IDs:', tableIds);
} else {
console.log('No tables found');
}
return false;
- หน้าหนังสือ :
- 1
ยังไม่มีการตอบกลับใดๆ สำหรับโพสต์นี้.
