ui-grid
ui-grid copied to clipboard
Editable fixing
I set editableCellTemplate with select.
To work correctrly need to comment code on line 3021 in ngCellHasFocus directive
elm.bind('mousedown', function(){
//elm.focus();
return true;
});
Yes, but instead of commenting the following may be a better idea:
elm.bind('mousedown', function(evt){
if (evt.target.nodeName != "OPTION") {
elm.focus();
}
return true;
});
In this style then need to if (evt.target.nodeName != "SELECT" && evt.target.nodeName != "OPTION")
So in 2.0.7, you are going to want this in a directive for your select:
elm.bind('click', function(evt) {
evt.stopPropagation();
});
elm.bind('mousedown', function(evt) {
evt.stopPropagation();
});
scope.$on('ngGridEventStartCellEdit', function () {
elm.focus();
});
angular.element(elm).bind('blur', function () {
scope.$emit('ngGridEventEndCellEdit');
});
You can look at the ngInput directive to see an example and also on the pull request to get an example of what to do: https://github.com/angular-ui/ng-grid/pull/511