[Phpmyadmin-devel] Inline editing and relational data

Marc Delisle marc at infomarc.info
Fri Jul 30 16:41:23 CEST 2010


Ninad Pundalik a écrit :
> Hi Marc,
> 
> Replies inline.
> 
> On 30/07/2010, Marc Delisle <marc at infomarc.info> wrote:
>> Ninad,
>> just to be sure you are aware of all the issues, here is a little overview.
>>
>> When you do "normal" edit of data, relational data (not just foreign
>> keys) is fetched. It can come from foreign keys (InnoDB, PBXT), or from
>> phpMyAdmin's configuration storage, see libraries/relation.lib.php in
>> PMA_getForeigners() and the "source" parameter.
>>
>> Also, $cfg['ForeignKeyMaxLimit'] plays an important role. This is
>> because we don't way to display a too big drop-down for the possible
>> values. If these are more than this limit, a link to
>> browse_foreigners.php is displayed, showing a distinct window with
>> search capabilities.
> The normal editing happens in tbl_change.php, and I almost completely
> copied the code from that file for retrieving the relational data.
> So, I'm calling PMA_getForeigners(), PMA_getForeignData() as well as
> PMA_foreignDropdown() to generate the <select> options.  Hence, these
> parameters have definitely been taken care of.

Try not to copy code but refactor if necessary.

Due to the column comments, I was always seeing an empty drop-down.
Without column comments, now I see the populated drop-down but when I 
try with $cfg['ForeignKeyMaxLimit'] equal or less than the number of 
rows in the linked table, I see an empty drop-down.

> 
>> There is also a "display field" that represents each row (for example,
>> the key would be "id" and the display field would be "city name").
>>
>> How do you plan to present relational data in the inline interface?
> I don't think I've considered this.  Is this what
> PMA_getDisplayField() is used for?  I'll look through the code to find
> it's usage examples and include it in inline editing.
> 
The display field is generated correctly in the drop-down menu when 
editing inline, as you used a standard function to generate it.

What's the plan about non-inline editing?

Another thing: in your tree, the table name is displayed twice on top, 
if there is a comment for this table (set from Operations).

-- 
Marc Delisle
http://infomarc.info




More information about the Developers mailing list