trabajando en el datatable

This commit is contained in:
2024-11-30 13:59:05 +01:00
parent c9c462ab92
commit d870fca64d
4 changed files with 122 additions and 30 deletions

View File

@ -21,9 +21,22 @@ class Language extends BaseController
public function getTranslation()
{
$translationFile = $this->request->getPost('translationFile');
$locale = $this->request->getPost('locale');
$path = "Language/{$locale}/$translationFile.php";
$lang = require APPPATH.$path;
return json_encode($lang);
$data = [];
if(is_array($translationFile)){
foreach($translationFile as $file){
$locale = $this->request->getPost('locale');
$path = "Language/{$locale}/$file.php";
$lang = require APPPATH.$path;
$data[$file] = $lang;
}
return json_encode($data);
}
else{
$locale = $this->request->getPost('locale');
$path = "Language/{$locale}/$translationFile.php";
$lang = require APPPATH.$path;
return json_encode($lang);
}
}
}

View File

@ -1046,6 +1046,8 @@ $(document).on('click', '.btn-remove', function(e) {
})
})
/*
var theTablePrecios = $('#tableOfPrecios').DataTable( {
serverSide: true,
processing: true,
@ -1143,7 +1145,7 @@ $(document).on('click', '.btn-remove', function(e) {
}
} ]
} );
*/
const initPrecioTemplate = <?php echo json_encode($precioTemplate);?>;
if(initPrecioTemplate != null){
@ -1151,7 +1153,7 @@ $(document).on('click', '.btn-remove', function(e) {
$('#plantillas').append(newOption);
}
/*
// Activate an inline edit on click of a table cell
$('#tableOfPrecios').on( 'click', 'tbody span.edit', function (e) {
editorPrecios.inline(
@ -1165,7 +1167,7 @@ $(document).on('click', '.btn-remove', function(e) {
}
);
} );
*/
// Delete row
$(document).on('click', '.btn-delete', function(e) {