Created
March 9, 2011 20:27
-
-
Save danil-z/862934 to your computer and use it in GitHub Desktop.
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
class ScheduleGrid < Netzke::Basepack::GridPanel | |
#.... | |
# i think it's too annoing click "add row" button if you add many rows in grid | |
# this addition to gridpanel allow you add a row automaticaly | |
# when you finished edit last row and hit tab or enter | |
js_method :walk_cells, <<-JS | |
function(row, col, step, fn, scope) { | |
var cell = #{js_full_class_name}.superclass.walkCells.apply(this, arguments); | |
if (!cell&&step>0) { | |
this.onAdd(); | |
// walk to first editable column of newly created row | |
row = this.getStore().getCount()-1; | |
col = 0; | |
cell = #{js_full_class_name}.superclass.walkCells.call(this, row, col, step, fn, scope); | |
} | |
return cell; | |
} | |
JS | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment