Hi Marc,
what will be your strategy on this (about avoiding code duplication)?
I was able to do the first part of ajaxify the insert option in the db->structure. I basically used db_structure.php and db_structure.js files for this modification.
In db_structure.js file I have used the two action to handle this.
- $("td.insert_table a.ajax").live('click',function(event){})
- $("#insertForm .insertRowTable input[value=Go], #buttonYes ").live('click', function(event) {})
In first event I used to pop up a dialog which carries the "insert table" form and I don't think it need any modification.
Then the second event handles the action after clicking the "Go" buttons at the "InsertRowTable" tables and the "Go" button at the "actions_panel". Currently I'm using the same action logic for both button clicks because I cannot clearly identify the importance of options in the "actions_panel" at this pop up dialog box. Please clarify me on this issue.
Currently after inserting to a table using this ajax form, the "Rows" column in the "tablesForm" does not get update. I tried to a get a similar approach in my last task for that by collecting the echos of "tablesForm" in the db_structure.php to a variable and then send it via PMA_ajaxResponse() method. But since db_structure.php uses PMA_TableHeader() method to echo the headers of the table it is difficult to do that. So what do you prefer in this situation.
Please help me on these issues. Thank you.
Regards,
Thilanka.
--
L G Thilanka Kaushalya
Computer Science & Engineering,
University of Moratuwa,
Sri Lanka
Connect with me at,
Gmail : lgtkaushalya@gmail.com
Twitter : @thilanka_k
Facebook : Thilanka Kaushalya
Yahoo : lgtkaushalya@yahoo.com