简体   繁体   中英

How do I get the values in php variables from a selected row in phpgrid?

I am trying to populate fields in a html form getting data values from a row selected by a user in phpgrid. So the phpgrid has a table from the database and I want to select a row which then gets populated in a html form. I tried using AJAX variables but nothing work. Please help me out.

You can do by creating a ShowSelectedRows function.

<script type="text/javascript">
    function ShowSelectedRows(){
    var rows = getSelRows();
        var dataIDs = $('#Data2').getDataIDs(); // #Data2 is the name given to your table
        gdata = $('#Data2').jqGrid('getRowData', rows[0]);
        console.log(gdata);
    }
</script>

Ensure to enable multiselect for rows. Hope it helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM