attachSearch(searchInstance) {
        return new Promise((resolve, reject) => {
            mvc.Components.getInstance(searchInstance).once(
                'search:done',
                function () {
                    this.data('results').once('data', function (_, data) {
                        if (data.rows.length !== 1) {
                            console.warn(`${searchInstance} returned more than one row`)
                        }
                        resolve(data) // .rows[0])
                    })
                }
            )
        })
    }
// Promise: Wait for search results of a search instance
Wait for search results of a search instance
Wait for search results of a search instance
attachSearch(searchInstance) {
        return new Promise((resolve, reject) => {
            mvc.Components.getInstance(searchInstance).once(
                'search:done',
                function () {
                    this.data('results').once('data', function (_, data) {
                        if (data.rows.length !== 1) {
                            console.warn(`${searchInstance} returned more than one row`)
                        }
                        resolve(data) 
                    })
                }
            )
        })
    }
attachSearch ( searchInstance ) { return new Promise ( ( resolve , reject ) => { mvc . Components . getInstance ( searchInstance ) . once ( 'search:done' , function ( ) { this . data ( 'results' ) . once ( 'data' , function ( _ , data ) { if ( data . rows . length !== 1 ) { console . warn ( ` ${ searchInstance } ` ) } resolve ( data ) } ) } ) } ) }
Promise: Wait for search results of a search instance
Promise : Wait for search results of a search instance
// .rows[0])