Ninad, when I edit a row, change a value and click Go:
1. I get a message "0 rows affected"
2. The row is redisplayed without the change
If I browse the table I see the change but I get:
Notice in ./libraries/common.lib.php#1065 Undefined index: cell_align_left
On 13/07/2010, Marc Delisle marc@infomarc.info wrote:
Ninad, when I edit a row, change a value and click Go:
I get a message "0 rows affected"
The row is redisplayed without the change
Editing of rows of data from a table? I'm yet to begin work on Inline editing. I am starting that in a couple of hours.
I remember reading a thread on this mailing list where possible options to enable inline editing were discussed, but I could not find that thread in the archives. I have these two ideas in mind:
1) - User clicks on the edit button in a row. Inline editing is activated and input fields are shown in place of the previous data. The edit button might be highlighted or a different icon could be used, to show that editing for that row is in progress. - The user modifies the data, and clicks on the edit button again. An Ajax request is fired off. - If the request completes successfully, the input fields are hidden/removed and the table shows the new data in that field/row.
2) - User clicks on the edit button for row1. Inline editing is activated same as above. - User modifies the data, and clicks on the edit button again. No Ajax request is fired off, but a 'Save Changes' button is appended after the data table. - User modifies row2, same as row1 (or for that matter, any number of rows). - Once he is satisfied with the changes, he clicks on the save changes button and the ajax request is fired off, saving changes.
Is there another possible idea for inline editing? And, which is the best from them all? I'll start modifying libraries/display_tbl.lib.php to include the input fields and start working on the first idea, till we are sure which idea is better. It can be further developed into the second idea with a few changes.
If I browse the table I see the change but I get:
Notice in ./libraries/common.lib.php#1065 Undefined index: cell_align_left
This error was reported by Dieter too. I'll use the debugger and find out if there is any statement that is causing $GLOBALS['cell_align_left'] to be unset before a call to PMA_showMessage().
Ninad Pundalik a écrit : (...)
I'm yet to begin work on Inline editing. I am starting that in a couple of hours.
I remember reading a thread on this mailing list where possible options to enable inline editing were discussed, but I could not find that thread in the archives. I have these two ideas in mind:
- User clicks on the edit button in a row. Inline editing is
activated and input fields are shown in place of the previous data. The edit button might be highlighted or a different icon could be used, to show that editing for that row is in progress.
- The user modifies the data, and clicks on the edit button again. An
Ajax request is fired off.
- If the request completes successfully, the input fields are
hidden/removed and the table shows the new data in that field/row.
Sorry to shoot more questions than answers here, here we go:
* does it mean that on a js-enabled browser, I would not be able to edit in a traditional way?
* sometimes, data in Browse mode is truncated (see $cfg['LimitChars']) but inline editing should permit to edit the complete data
* data can be transformed (see http://www.phpmyadmin.net/documentation/Documentation.html#transformations)
* the display options can alter the data (partial/full text, relation key/relational display field, etc)
* should a new inline edit icon be displayed along with the current one, or should you use the same icon?
* what would happen with the rows checkbox which permit to edit the marked rows?
- User clicks on the edit button for row1. Inline editing is
activated same as above.
- User modifies the data, and clicks on the edit button again. No
Ajax request is fired off, but a 'Save Changes' button is appended after the data table.
- User modifies row2, same as row1 (or for that matter, any number of rows).
- Once he is satisfied with the changes, he clicks on the save changes
button and the ajax request is fired off, saving changes.
Is there another possible idea for inline editing? And, which is the best from them all? I'll start modifying libraries/display_tbl.lib.php to include the input fields and start working on the first idea, till we are sure which idea is better. It can be further developed into the second idea with a few changes.
On 13/07/2010, Marc Delisle marc@infomarc.info wrote:
Sorry to shoot more questions than answers here, here we go:
But this will lead to me understanding the situation better, so please keep them coming. :)
- does it mean that on a js-enabled browser, I would not be able to edit
in a traditional way?
If we are to use the same edit icon for inline editing, jQuery will prevent the traditional behaviour. If we want to preserve traditional behaviour, we could either add a separate icon for inline editing, or add a toggle checkbox/button on the page, which activates/deactivates inline editing.
- sometimes, data in Browse mode is truncated (see $cfg['LimitChars'])
but inline editing should permit to edit the complete data
When data is truncated, an ajax request could be made to retrieve the complete data for inline editing. We could ignore $cfg['LimitChars'] for this request.
- data can be transformed (see
http://www.phpmyadmin.net/documentation/Documentation.html#transformations)
I did not know about this. Will read through the code and understand how this works.
- the display options can alter the data (partial/full text, relation
key/relational display field, etc)
I'll keep this in mind when writing the code, it should be able to handle these conditions.
- should a new inline edit icon be displayed along with the current one,
or should you use the same icon?
I guess this answer depends on the first question's answer. :)
- what would happen with the rows checkbox which permit to edit the
marked rows?
I could modify it's behaviour with jQuery, and trigger an inline edit event on all the marked checkbox rows. Otherwise, if this behaviour is not expected/intuitive, I could hide that icon with jQuery while inline editing is active.
Hi!
- does it mean that on a js-enabled browser, I would not be able to edit
in a traditional way?
If we are to use the same edit icon for inline editing, jQuery will prevent the traditional behaviour. If we want to preserve traditional behaviour, we could either add a separate icon for inline editing, or add a toggle checkbox/button on the page, which activates/deactivates inline editing.
Personally I would prefer the inline editing to simply trigger on an "onclick" event within any of the cells of a row. The edit icon should IMHO still point to the old behavior. I, for one, often use Ctrl-Click on multiple rows to spawn tabs in my browser to edit multiple records. This great behavior should still work, and with default jquery behavior it would prevent this.
I'm very excited about this upcoming feature. :-)
Regards, Garvin
Garvin Hicking a écrit :
Hi! Personally I would prefer the inline editing to simply trigger on an "onclick" event within any of the cells of a row. The edit icon should IMHO still point to the old behavior. I, for one, often use Ctrl-Click on multiple rows to spawn tabs in my browser to edit multiple records. This great behavior should still work, and with default jquery behavior it would prevent this.
I'm very excited about this upcoming feature. :-)
Regards, Garvin
Hi Garvin, what you suggest starts to look like some kind of spreadsheet, right? I agree that it's intuitive but won't fit well with other things in phpMyAdmin. You might remember transformations :) where a link can be shown at browse time, instead of data.
- data can be transformed (see
http://www.phpmyadmin.net/documentation/Documentation.html#transformations)
I did not know about this. Will read through the code and understand how this works.
Should inline editing support just the transformations provided by default in phpMyAdmin, or also custom transformations? If custom transformations are to be supported, then I should be developing some sort of a callback mechanism that will handle custom transformations.
For inline editing of fields that have their MIME-type set to images, should the user be able to edit just the path or anything else?
Ninad Pundalik a écrit :
- data can be transformed (see
http://www.phpmyadmin.net/documentation/Documentation.html#transformations)
I did not know about this. Will read through the code and understand how this works.
Should inline editing support just the transformations provided by default in phpMyAdmin, or also custom transformations? If custom transformations are to be supported, then I should be developing some sort of a callback mechanism that will handle custom transformations.
I don't believe that many custom transformations have been developed (I never heard of any) so just handle those that are part of the code.
For inline editing of fields that have their MIME-type set to images, should the user be able to edit just the path or anything else?
I think that just the path is fine.
Marc Delisle a écrit :
Ninad, when I edit a row, change a value and click Go:
I get a message "0 rows affected"
The row is redisplayed without the change
I did not mean inline editing, just clicking on the pencil to edit a row. Some Ajaxification was done about this as I see a top message.