@@ -686,10 +686,16 @@ angular.module('ui.grid')
686
686
* @param {string } name column name
687
687
*/
688
688
Grid . prototype . getColumn = function getColumn ( name ) {
689
+ if ( angular . isFunction ( this . columns . find ) ) {
690
+ return this . columns . find ( function ( column ) {
691
+ return column . colDef . name === name ;
692
+ } ) || null ;
693
+ }
694
+
689
695
var result = null ;
690
- lookInRows . every ( function ( row ) {
696
+ this . columns . every ( function ( column ) {
691
697
if ( column . colDef . name === name ) {
692
- result = row ;
698
+ result = column ;
693
699
return false ;
694
700
}
695
701
return true ;
@@ -705,10 +711,16 @@ angular.module('ui.grid')
705
711
* @param {string } name column.field
706
712
*/
707
713
Grid . prototype . getColDef = function getColDef ( name ) {
714
+ if ( angular . isFunction ( this . options . columnsDefs . find ) ) {
715
+ return this . options . columnsDefs . find ( function ( colDef ) {
716
+ return colDef . name === name ;
717
+ } ) || null ;
718
+ }
719
+
708
720
var result = null ;
709
- lookInRows . every ( function ( row ) {
721
+ this . options . columnsDefs . every ( function ( colDef ) {
710
722
if ( colDef . name === name ) {
711
- result = row ;
723
+ result = colDef ;
712
724
return false ;
713
725
}
714
726
return true ;
@@ -1094,6 +1106,11 @@ angular.module('ui.grid')
1094
1106
Grid . prototype . getRow = function getRow ( rowEntity , lookInRows ) {
1095
1107
var self = this ;
1096
1108
lookInRows = lookInRows == void 0 ? this . rows : lookInRows ;
1109
+ if ( angular . isFunction ( lookInRows . find ) ) {
1110
+ return lookInRows . find ( function ( row ) {
1111
+ return self . options . rowEquality ( row . entity , rowEntity ) ;
1112
+ } ) || null ;
1113
+ }
1097
1114
1098
1115
var result = null ;
1099
1116
lookInRows . every ( function ( row ) {
0 commit comments