Skip to content

Instantly share code, notes, and snippets.

@wilcorrea
Forked from fininhors/funcoes.js
Last active March 27, 2018 16:34
Show Gist options
  • Save wilcorrea/1a0c930dab354cea4db43a1723ecf9ce to your computer and use it in GitHub Desktop.
Save wilcorrea/1a0c930dab354cea4db43a1723ecf9ce to your computer and use it in GitHub Desktop.
/**
* @param {string} id
* @param {string} form
*/
function Gerador (id, form)
{
this.__id = id
this.__form = form || 'formUsuario'
/**
* @param {string} hidden
* @param {string} page
* @param {string} div
* @param {boolean} clear
*/
this.gerarGrid = function(hidden, page, div, clear) {
const $element = $(this.__id)
$element.val(hidden);
this.gerarGridJSON(this.__form, page, div);
if (clear) {
$element.val('');
}
}
/**
*/
this.gerarGridAcesso() {
this.gerarGrid('searchACE', 'transactionAcesso.php', 'div_manutencao_acesso', true)
}
/**
*/
this.gerarGridDocumentosPendentes() {
this.gerarGrid('searchUXD', 'transactionUsuariosxDocumentoPendente.php', 'div_manutencao_pendente')
}
/* ... */
}
const gerador = new Gerador('#hdn_metodo_search')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment