Timepicker

Discuss MySQL Ajax Table Editor Paid Version

Timepicker

Postby odiggy » Tue May 08, 2018 2:58 am

Can anyone post example code to insert a Timepicker. I did find this post: https://mysqlajaxtableeditor.com/discussmate/viewtopic.php?f=4&t=1405&p=5375&hilit=timepicker&sid=3a484d3a4584408d8ad7bb1563b190d9&sid=3a484d3a4584408d8ad7bb1563b190d9#p5375 but can't figure it out still.

I have tried a few timepickers and can't seem to get it. I'm willing to Paypal you beer money.

http://timepicker.co
http://jonthornton.github.io/jquery-timepicker

:)
odiggy
 
Posts: 9
Joined: Sat Apr 28, 2018 2:35 am

Re: Timepicker

Postby odiggy » Tue May 15, 2018 12:56 am

Nevermind I figured it out.

Insert this into common.php after <head>

Code: Select all
<link rel="stylesheet" type="text/css" href="jonthornton-jquery-timepicker/jquery.timepicker.css" />
   <script type="text/javascript" src="jonthornton-jquery-timepicker/jquery.timepicker.min.js"></script>


and before function initiateEditor()

Code: Select all
//timepicker callback
function timepicker()
   {
   $this->Editor->addJavascript(
      '$(function(){$(\'.mate_time\').timepicker({ \'scrollDefault\': \'now\' });});'
   )
   ;}



then for my tableColumn

Code: Select all
      $tableColumns['start_time'] = array(
      'display_text' => 'H/U Time',
      'perms' => 'EVCTAXQSFHO',
      'input_info' => 'class="mate_time"',
      'table_fun' => array(&$this,'timeFormat'),
      'view_fun' => array(&$this,'timeFormat'),
      'timepicker' => array(
               'timeFormat' => 'H:i'
      )
      );   



For input_info i changed to class instead of id and used mate_time.


Cheers!
odiggy
 
Posts: 9
Joined: Sat Apr 28, 2018 2:35 am

Re: Timepicker

Postby odiggy » Mon Jun 18, 2018 8:19 pm

Sorry I forgot also add this:
Code: Select all
      $this->Editor->setConfig('addScreenFun',array(&$this,'timepicker'));
      $this->Editor->setConfig('editScreenFun',array(&$this,'timepicker'));
odiggy
 
Posts: 9
Joined: Sat Apr 28, 2018 2:35 am


Return to Paid Version

Who is online

Users browsing this forum: No registered users and 4 guests

cron