Skip to content

Instantly share code, notes, and snippets.

@Marlysson
Last active March 29, 2022 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Marlysson/5c40796c6d8e873f50de7fbfcc3c1a79 to your computer and use it in GitHub Desktop.
Save Marlysson/5c40796c6d8e873f50de7fbfcc3c1a79 to your computer and use it in GitHub Desktop.
tabCell function overriding
if (PrimeFaces.widget.DataTable) {
PrimeFaces.widget.DataTable.prototype.tabCell = function(celula, frente){
var celulaAlvo = frente ? celula.nextAll("td.ui-editable-column:first") : celula.prevAll("td.ui-editable-column:first");
if (celulaAlvo.length == 0) {
var linha = frente ? celula.parent().next() : celula.parent().prev();
celulaAlvo = frente ? linha.children("td.ui-editable-column:first") : linha.children("td.ui-editable-column:last");
}
this.showCellEditor(celulaAlvo);
// Tried too calling as: PrimeFaces.widget.DataTable.prototype.showCellEditor(celulaAlvo)
// but the next cell is focused but current one edited don't out of edit state, keeping two cell as edit state
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment