Zend certified PHP/Magento developer

Get value from modal popup to form

it have modal popup with grid. In my action column in grid use button. I need when click to this button, modal popup will close and value fill in my form field. Anybody who can help me?

    <modal name="adresar_data_modal">            
        <fieldset>
            <settings>
                <label>Adresář</label>
            </settings>
        
            <insertListing name="adresar_data_grid" >
                <settings>
                    <dataLinks>
                        <exports>false</exports>
                        <imports>true</imports>
                    </dataLinks>
                    <autoRender>true</autoRender>
                    <selectionsProvider>adresar_data_grid.adresar_data_grid_data_source</selectionsProvider>
                    <dataScope>adresar_data_grid</dataScope>
                    <ns>adresar_data_grid</ns>
                </settings>
            </insertListing>            
        </fieldset>
    </modal>

And this is action column

public function prepareDataSource(array $dataSource)
        {
        if (isset($dataSource['data']['items'])) 
            {
            $fieldName = $this->getData('name');
            foreach ($dataSource['data']['items'] as & $item) 
                {
                if (isset($item['id'])) 
                    {
                    $name = $this->DataHelper->getname($item['id']); // this value i need put in field name
                    $html = '<input type="button" id="pridat" value="Přidat"/>';
                    $item[$fieldName] = $html;
                    }
                }
            }
        return $dataSource;
        }