Thilanka, There is a problem with this feature: when the table has a DATETIME column, the picker icon does not show up.
Have a look at [0] where Rouslan explains that he fixed a similar problem in his repository.
[0] https://sourceforge.net/tracker/index.php?func=detail&aid=3354360&gr...
On Wed, 2011-07-06 at 09:48 -0400, Marc Delisle wrote:
Thilanka, There is a problem with this feature: when the table has a DATETIME column, the picker icon does not show up.
Have a look at [0] where Rouslan explains that he fixed a similar problem in his repository.
[0] https://sourceforge.net/tracker/index.php?func=detail&aid=3354360&gr...
The problem there is that the datepickers/timepickers are attached to all relevant fields on page-load by functions.js, however in AJAX mode the fields are created after page-load and the pickers are not attached, so it's necessary to bind them manually after showing the dialog to the user. My code for this looks like this (the snipped is simplified for clarity):
---SNIP--- /** * Display the dialog to the user */ RTE.$ajaxDialog = $('<div>' + data.message + '</div>').dialog(options); RTE.$ajaxDialog.find('.datefield, .datetimefield').each(function () { PMA_addDatepicker($(this)); }); ---SNIP---
Rouslan
On Wed, 2011-07-06 at 14:57 +0100, Rouslan Placella wrote:
On Wed, 2011-07-06 at 09:48 -0400, Marc Delisle wrote:
Thilanka, There is a problem with this feature: when the table has a DATETIME column, the picker icon does not show up.
Have a look at [0] where Rouslan explains that he fixed a similar problem in his repository.
[0] https://sourceforge.net/tracker/index.php?func=detail&aid=3354360&gr...
The problem there is that the datepickers/timepickers are attached to all relevant fields on page-load by functions.js, however in AJAX mode the fields are created after page-load and the pickers are not attached, so it's necessary to bind them manually after showing the dialog to the user. My code for this looks like this (the snipped is simplified for clarity):
---SNIP--- /**
- Display the dialog to the user
*/ RTE.$ajaxDialog = $('<div>' + data.message + '</div>').dialog(options); RTE.$ajaxDialog.find('.datefield, .datetimefield').each(function () { PMA_addDatepicker($(this)); }); ---SNIP---
Rouslan
Just saw another relevant thing. The qTips have to also be bound manually in AJAX dialogs, right now in your "database structure->insert" dialog the footnotes are used (which are meant for when JS is disabled). Look for sample code in functions.js for how to bind the tooltips.
Another thing that you might want to keep in mind is that after using the "continue insertion with X rows", the pickers have to be properly rebound to date/time fields. Not sure how helpful it'll be, but you might want to look at this patch (and other nearby code in that source code file): https://sourceforge.net/tracker/?func=detail&aid=3261058&group_id=23...
Rouslan
Hi Marc and Rouslan,
There is a problem with this feature: when the table has a DATETIME
column, the picker icon does not show up.
Have a look at [0] where Rouslan explains that he fixed a similar problem in his repository.
[0]
https://sourceforge.net/tracker/index.php?func=detail&aid=3354360&gr...
Okay. I'll go through that.
The problem there is that the datepickers/timepickers are attached to all relevant fields on page-load by functions.js, however in AJAX mode the fields are created after page-load and the pickers are not attached, so it's necessary to bind them manually after showing the dialog to the user. My code for this looks like this (the snipped is simplified for clarity):
---SNIP--- /**
- Display the dialog to the user
*/ RTE.$ajaxDialog = $('<div>' + data.message + '</div>').dialog(options); RTE.$ajaxDialog.find('.datefield, .datetimefield').each(function () { PMA_addDatepicker($(this)); }); ---SNIP---
Thanks for the information.
Regards, Thilanka.
Hi Marc and Rouslan,
The problem there is that the datepickers/timepickers are attached to
all relevant fields on page-load by functions.js, however in AJAX mode the fields are created after page-load and the pickers are not attached, so it's necessary to bind them manually after showing the dialog to the user. My code for this looks like this (the snipped is simplified for clarity):
---SNIP--- /**
- Display the dialog to the user
*/ RTE.$ajaxDialog = $('<div>' + data.message + '</div>').dialog(options); RTE.$ajaxDialog.find('.datefield, .datetimefield').each(function () { PMA_addDatepicker($(this)); }); ---SNIP---
These information were very helpful for me.
I went through you logic and modified my code for insert dialog and now the date pickers are working correctly. I pushed my changes to the repo. Please check that.
Regards, Thilanka.
Le 2011-07-08 12:33, Thilanka Kaushalya a écrit :
Hi Marc and Rouslan,
The problem there is that the datepickers/timepickers are attached to all relevant fields on page-load by functions.js, however in AJAX mode the fields are created after page-load and the pickers are not attached, so it's necessary to bind them manually after showing the dialog to the user. My code for this looks like this (the snipped is simplified for clarity): ---SNIP--- /** * Display the dialog to the user */ RTE.$ajaxDialog = $('<div>' + data.message + '</div>').dialog(options); RTE.$ajaxDialog.find('.datefield, .datetimefield').each(function () { PMA_addDatepicker($(this)); }); ---SNIP---
These information were very helpful for me.
I went through you logic and modified my code for insert dialog and now the date pickers are working correctly. I pushed my changes to the repo. Please check that.
Thilanka, it works for a DATE column but try it with DATETIME column. When inserting in a traditional way, the picker also contains a time picker, but not in your AJAXified version.
Hi Marc,
it works for a DATE column but try it with DATETIME column. When
inserting in a traditional way, the picker also contains a time picker, but not in your AJAXified version.
I'm very sorry that in last commit I could not include the timepicker.js file to tbl_structure.php file. I fixed the issue and pushed to the repo. Please check that. Thank you.
Regards, Thilanka.
Le 2011-07-08 21:49, Thilanka Kaushalya a écrit :
Hi Marc,
it works for a DATE column but try it with DATETIME column. When inserting in a traditional way, the picker also contains a time picker, but not in your AJAXified version.
I'm very sorry that in last commit I could not include the timepicker.js file to tbl_structure.php file. I fixed the issue and pushed to the repo. Please check that. Thank you.
Regards, Thilanka.
Thanks, I did a cherry-pick on this fix and it's now part of the official tree.