@@ -2512,10 +2512,32 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
25122512 this . focusRowInGrid ( row ) ;
25132513 return ;
25142514 }
2515+
2516+ const cursorRow = this . grid ?. state . cursorRow ;
2517+ const cursorColumn = this . grid ?. state . cursorColumn ;
2518+
2519+ if ( cursorRow == null || cursorColumn == null ) {
2520+ // if a cell is not selected / grid is not rendered
2521+ this . setState ( {
2522+ isGotoShown : ! isGotoShown ,
2523+ gotoRow : '' ,
2524+ gotoValue : '' ,
2525+ gotoRowError : '' ,
2526+ gotoValueError : '' ,
2527+ } ) ;
2528+ return ;
2529+ }
2530+ // if a row is selected
2531+ const { model } = this . props ;
2532+ const { name, type } = model . columns [ cursorColumn ] ;
2533+
2534+ const cellValue = model . valueForCell ( cursorColumn , cursorRow ) ;
2535+ const text = IrisGridUtils . convertValueToText ( cellValue , type ) ;
25152536 this . setState ( {
25162537 isGotoShown : ! isGotoShown ,
2517- gotoRow : '' ,
2518- gotoValue : '' ,
2538+ gotoRow : `${ cursorRow } ` ,
2539+ gotoValue : text ,
2540+ gotoValueSelectedColumnName : name ,
25192541 gotoRowError : '' ,
25202542 gotoValueError : '' ,
25212543 } ) ;
@@ -3278,19 +3300,16 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
32783300 if ( inputString === '' ) {
32793301 return ;
32803302 }
3303+ const selectedColumn = IrisGridUtils . getColumnByName (
3304+ model . columns ,
3305+ selectedColumnName
3306+ ) ;
32813307
3282- const columnIndex = model . getColumnIndexByName ( selectedColumnName ) ;
3283- if ( columnIndex === undefined ) {
3308+ if ( selectedColumn === undefined ) {
32843309 return ;
32853310 }
32863311
3287- const selectedColumn = model . columns [ columnIndex ] ;
3288-
3289- let searchFromRow ;
3290-
3291- if ( this . grid ) {
3292- ( { selectionEndRow : searchFromRow } = this . grid . state ) ;
3293- }
3312+ let searchFromRow = this . grid ?. state . cursorRow ;
32943313
32953314 if ( searchFromRow == null ) {
32963315 searchFromRow = 0 ;
@@ -3302,11 +3321,13 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
33023321 gotoValueSelectedFilter === FilterType . eqIgnoreCase ;
33033322
33043323 try {
3324+ const { formatter } = model ;
33053325 const columnDataType = TableUtils . getNormalizedType ( selectedColumn . type ) ;
33063326
33073327 let rowIndex ;
33083328
33093329 switch ( columnDataType ) {
3330+ case TableUtils . dataType . CHAR :
33103331 case TableUtils . dataType . STRING : {
33113332 rowIndex = await model . seekRow (
33123333 isBackwards === true ? searchFromRow - 1 : searchFromRow + 1 ,
@@ -3320,7 +3341,6 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
33203341 break ;
33213342 }
33223343 case TableUtils . dataType . DATETIME : {
3323- const { formatter } = model ;
33243344 const [ startDate ] = DateUtils . parseDateRange (
33253345 inputString ,
33263346 formatter . timeZone
@@ -3342,7 +3362,13 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
33423362 ! TableUtils . isBigDecimalType ( selectedColumn . type ) &&
33433363 ! TableUtils . isBigIntegerType ( selectedColumn . type )
33443364 ) {
3345- const inputValue = parseInt ( inputString , 10 ) ;
3365+ let inputValue = parseInt ( inputString , 10 ) ;
3366+ if ( inputString === '-Infinity' ) {
3367+ inputValue = Number . NEGATIVE_INFINITY ;
3368+ } else if ( inputString === 'Infinity' ) {
3369+ inputValue = Number . POSITIVE_INFINITY ;
3370+ }
3371+
33463372 rowIndex = await model . seekRow (
33473373 searchFromRow ,
33483374 selectedColumn ,
@@ -3370,7 +3396,11 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
33703396 searchFromRow ,
33713397 selectedColumn ,
33723398 dh . ValueType . STRING ,
3373- inputString ,
3399+ TableUtils . makeValue (
3400+ selectedColumn . type ,
3401+ inputString ,
3402+ formatter . timeZone
3403+ ) ,
33743404 undefined ,
33753405 undefined ,
33763406 isBackwards ?? false
@@ -3731,6 +3761,23 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
37313761 }
37323762
37333763 handleGotoValueSelectedColumnNameChanged ( columnName : ColumnName ) : void {
3764+ const { model } = this . props ;
3765+ const cursorRow = this . grid ?. state . cursorRow ;
3766+
3767+ if ( cursorRow != null ) {
3768+ const index = model . getColumnIndexByName ( columnName ) ;
3769+ const column = IrisGridUtils . getColumnByName ( model . columns , columnName ) ;
3770+ if ( index == null || column == null ) {
3771+ return ;
3772+ }
3773+ const value = model . valueForCell ( index , cursorRow ) ;
3774+ const text = IrisGridUtils . convertValueToText ( value , column . type ) ;
3775+ this . setState ( {
3776+ gotoValueSelectedColumnName : columnName ,
3777+ gotoValue : text ,
3778+ gotoValueError : '' ,
3779+ } ) ;
3780+ }
37343781 this . setState ( {
37353782 gotoValueSelectedColumnName : columnName ,
37363783 gotoValueError : '' ,
0 commit comments