Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I edit a column when I double click on it?

I am using a table to view some of the data, the table looks like below

<table>
    <tr>
        <th>Id</th>
        <th>Name</th>
        <th>Salary</th>
    </tr>
    <tr>
        <td>1</td>
        <td>Imthi</td>
        <td>30000</td>
    </tr>
</table>  

I want to edit the salary column in the above table when I double click that column. Can anyone help me achieve this?

like image 583
bhai Avatar asked Mar 20 '23 20:03

bhai


1 Answers

ondblclick="return editColumn(\''.$UniqueId.'\');"

use Ajax to call a page edit.php

edit.php
---------

Show text box with value, SAve and Cancel Button

save.php
---------

click Save - call the ajax function pass the Id and Value to this page Use query to update

like image 123
J.K Avatar answered Mar 22 '23 20:03

J.K