Last active
March 29, 2022 18:42
-
-
Save Marlysson/5c40796c6d8e873f50de7fbfcc3c1a79 to your computer and use it in GitHub Desktop.
tabCell function overriding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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