Pass More that one database record from child window to parent window dynamically

爱⌒轻易说出口 提交于 2019-12-08 03:48:07

问题


How to add multiple record from child window to the parent window.? Means when we select multiple records from child window pass that records to parent window and also update parent window without page refresh....

http://demo.vtiger.com/index.php?module=Invoice&action=EditView&return_action=DetailView&parenttab=Sales

use that link and add invoice from there...then goto add products one window will popup i want same functionality but dont have idea where to start


回答1:


First of all create jquery function in parent window with some html dom in which response from child window can be placed on.

Now in child window code data for listing and create function and call parent window function from child and process for the same.

sample is as below,

Html for Parent window

<input type ="text" name="customername" id="customername" />
<input type ="text" name="customeraddress" id="customeraddress" />
<input type ="text" name="customertown" id="customertown"/>
<input type ="text" name="customercountry" id="customercountry"/>

open child window from here.

Child page code is as below,


function post_value(cname,caddress,ctown,ccount,cpincode,id)
    {
        window.opener.document.getElementById('customername').value = cname;
        window.opener.document.getElementById('customeraddress').value = caddress;
        window.opener.document.getElementById('customertown').value = ctown;
        window.opener.document.getElementById('customercountry').value = ccount;
        self.close();
        window.close();
        return false;
    }

In above code add checkbox and php code to select record which u need to add in parent window. Now see the result you will have what you wanted.

Cheers.



来源:https://stackoverflow.com/questions/4847687/pass-more-that-one-database-record-from-child-window-to-parent-window-dynamicall

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!