Problem with add_fun callback

Discuss MySQL Ajax Table Editor Paid Version

Problem with add_fun callback

Postby lukasnem » Wed Feb 17, 2016 1:41 pm

Hello,

I am using free version of Mate more than 4 years, now i decided to upgrade to newest paid version. There is lot of changes I must implement to my project.

I have problem with add_fun callback. Input that belongs to $tableColumns['ID'] is still empty, but it should contain '123456789'. When I change add_fun to edit_fun it works (on edit page input contain '123456789').

$tableColumns['ID'] = array(
'display_text' => 'ID',
'perms' => 'EVCTAXQSHO', 'add_fun' => array(&$this,'generateid')
);

function generateid($col,$val,$row,$instanceName)
{
//$query = "SELECT ID FROM untable ORDER BY ID DESC LIMIT 1;";
//$result = $this->Editor->doQuery($query);
//$row = $result->fetch(PDO::FETCH_ASSOC);
//$val = $row['ID']+1;
$val = '123456789';
return $val;
}


Second problem with passing $_GET variable:
https://mysqlajaxtableeditor.com/discussmate/viewtopic.php?p=5389&sid=10d615dbe318096de4f9a8b353039244&sid=10d615dbe318096de4f9a8b353039244#p5389

Please give me any advice

Thank you
lukasnem
 
Posts: 5
Joined: Tue Feb 16, 2016 12:10 pm

Re: Problem with add_fun callback

Postby lukasnem » Fri Feb 19, 2016 7:25 pm

Hello,

after some research I founded that the problem is in getInputDefaultValue function.
I changed this:
Code: Select all
if(isset($val) && strlen($val) > 0)


to this

Code: Select all
if(isset($val))


and now it is ok for me.

This change causes some problems with inbuilt calendar (tested on Autocomplete example).


Lukas
lukasnem
 
Posts: 5
Joined: Tue Feb 16, 2016 12:10 pm


Return to Paid Version

Who is online

Users browsing this forum: No registered users and 1 guest

cron