Skip to content

Update rodape.php#8

Open
cezargf wants to merge 1 commit into
masterfrom
cezargf-patch-1
Open

Update rodape.php#8
cezargf wants to merge 1 commit into
masterfrom
cezargf-patch-1

Conversation

@cezargf
Copy link
Copy Markdown
Owner

@cezargf cezargf commented May 19, 2026

Adicionar a propriedade pageLength correspondente ao valor configurado no sistema.

Ao configurar a quantidade de registros exibidos por página, quando a visualização em DataTables está ativada e configurada para exibir acima de 10 registros por página, a exibição de quantidade de registros por página nas telas de listagem não correspondem ao valor configurado.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the DataTables initialization in the footer view to include a dynamic page length setting based on the configuration. The review feedback suggests improving the robustness of this change by providing a default value and ensuring the value is cast to an integer to avoid potential JavaScript syntax errors if the configuration is missing.

var dataTableEnabled = '<?= $configuration['control_datatable'] ?>';
if(dataTableEnabled == '1') {
$('#tabela').dataTable( {
"pageLength": <?= $configuration['per_page'] ?>,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

O código atual pode causar um erro de sintaxe JavaScript se a configuração per_page não estiver definida, o que pode quebrar a funcionalidade das tabelas. Para tornar o código mais robusto, é recomendável fornecer um valor padrão caso a configuração não exista.

Além disso, a propriedade pageLength do DataTables espera um número inteiro. Converter o valor para int garante que o tipo de dado correto seja sempre utilizado.

"pageLength": <?= (int) ($configuration['per_page'] ?? 10) ?>,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant