Jump to content


callbackColumn not working for certain type of fields


  • Please log in to reply
2 replies to this topic

#1 cletourneau

cletourneau

    Member

  • Members
  • PipPip
  • 15 posts
  • LocationMontreal

Posted 06 October 2017 - 08:17 PM

I just tested callbackColumn for some type of fields (MySQL), here's my code :

        $this->crud->setTable('my_table')
            ->setSubject('a line')
            ->callbackColumn('col_integer', function ($value, $row) {
                return "<a href='/integer/" . $value."' target='blank'>$value</a>";
            })
            ->callbackColumn('col_decimal', function ($value, $row) {
                return "<a href='/decimal/" . $value."' target='blank'>$value</a>";
            })
            ->callbackColumn('col_varchar', function ($value, $row) {
                return "<a href='/varchar/" . $value."' target='blank'>$value</a>";
            })
            ->callbackColumn('col_date', function ($value, $row) {
                return "<a href='/date/" . $value."' target='blank'>$value</a>";
            })
            ->callbackColumn('col_datetime', function ($value, $row) {
                return "<a href='/datetime/" . $value."' target='blank'>$value</a>";
            })
            ->callbackColumn('col_bool', function ($value, $row) {
                return "<a href='/bool/" . $value."' target='blank'>$value</a>";
            })
            ->displayAs('col_integer', 'Integer number')
            ->displayAs('col_decimal', 'Real number')
            ->displayAs('col_varchar', 'Character array')
            ->displayAs('col_date', 'Date')
            ->displayAs('col_datetime', 'Date and time')
            ->displayAs('col_bool', 'Boolean choice')
            ->editFields([
                'col_integer',
                'col_decimal',
                'col_varchar',
                'col_date',
                'col_datetime',
                'col_bool'
            ])
        ;

Here's my result :

 

col_integer : working

col_decimal : working

col_varchar : working

col_date : not working (nothing is displayed)

col_datetime : not working (nothing is displayed)

col_bool (tinyint) : working

 

Could you confirm the problem?

 

Thanks

 



#2 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,095 posts
  • LocationLondon

Posted 10 October 2017 - 12:29 PM

Hello @cletourneau,

 

I confirm that this is a bug. This is a more complicated (and different) bug from the one mentioned here: https://www.groceryc...-bool-tinyint1/ so I can't solve it straight away! I did create a ticket to my backlog so I can find a solution to the upcoming releases.

Regards

Johnny


Posted Image

#3 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,095 posts
  • LocationLondon

Posted 12 October 2017 - 07:51 PM

Hello @cletourneau,

 

This is now fixed and it will be released with the new version 2.3.6 of Grocery CRUD Enterprise.

 

Regards

Johnny


Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users