Get KoolPHP UI with 30% OFF!

Link in Column

Klaus
Hi,
I am a beginner with KoolPHP and have not yet found out how to
add a column to a koolgrid with an icon or image and let the user
navigate to another page by clicking on this image/icon.
Can somebody help me please with a code snippet?
Best regards
Posted May 26, 2017 Kool
Anthony Amolochitis
Here is a custom column as a link.
        $template = '<a href="http://link.com">Your Link </a>' ;
        $column = new gridcustomcolumn()    ;
        $column->DataField = 'searchField'  ;
        $column->Width = '450px'            ;
        $column->HeaderText = 'Search'      ;
        $column->Valign = 'top'             ;
        $column->FilterOptions = array('Contain');
        $column->AllowSorting = false       ;
        $column->ItemTemplate = $template;
        $this->KoolGrid->MasterTable->addcolumn($column) ;
Posted May 26, 2017 Kool
Klaus
Dear Anthony,
thank you for your fast reply.
The link works fine.
Could you please be so kind to tell me how to get an icon into the colum?
Best regards
Klaus
Posted May 27, 2017 Kool
Anthony Amolochitis
In the part of the code which says "Your Link", just input your image source tag for your icon and it will work.
Posted May 27, 2017 Kool
Klaus
Hi Anthony,
thanks a lot.
Posted May 27, 2017 Kool
Anthony Amolochitis
No problem. The custom column allows you to input any html as the column contents that you wish, including your mysql row record fields.
Use the "{FieldName}" to input the field data into your links, or other html.
Take it easy.
Posted May 27, 2017 Kool