Customizing the data displayed in the table view

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
epano
Posts: 19
Joined: 2020-07-09 11:56

Customizing the data displayed in the table view

Post by epano » 2020-08-21 09:41

Hello,

I hope you are fine, I need help if possible .

I found in the appgini web platform a hook customization

https://bigprof.com/appgini/tips-and-tu ... eview-data

It interested me but i can not make it working. I used the code exactly as it is on the website with my table and line but it is not working. I think the problem is with the line:

Code: Select all

 $modField = "CONCAT('<img src="\"hooks/',`cameras`.`ratings`,'.gif\"" border="\"0\"">')";
I would appreciate if you can help me to find the error. Thank in advance and all the best.

Best regards,

Ervis

pfrumkin
Veteran Member
Posts: 157
Joined: 2020-02-18 17:58
Location: Albuquerque, New Mexico USA

Re: Customizing the data displayed in the table view

Post by pfrumkin » 2020-08-21 15:28

Hi Ervis,

Please provide more information. Specifically
1) What is the problem, what error are you seeing, what isn't working?
2) The code for the entire hook. I assume that it is the cameras_init hook, but I don't know.

~Paul

epano
Posts: 19
Joined: 2020-07-09 11:56

Re: Customizing the data displayed in the table view

Post by epano » 2020-08-21 16:00

Yes it table_init hook where i want to change the appearance in TV from a specific text to picture. Find the full code:

Code: Select all

function cameras_init(&$options, $memberInfo, &$args){

    $oldFields = $options->QueryFieldsTV;
     
    foreach($oldFields as $field => $title){
  
        if($field == '`cameras`.`ratings`'){

            $modField = "CONCAT('<img src="\"hooks/',`cameras`.`ratings`,'.gif\"" border="\"0\"">')";
            $newFields[$modField] = $title;
        }else{
            $newFields[$field] = $title;
        }
    }
     
    $options->QueryFieldsTV = $newFields;
     
    return TRUE;
}
The TV of cameras table show an error message:
Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR) in C:\xampp\htdocs\fshzh\hooks\cameras.php on line 38
The line 38 is the line i posted in previous post

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Customizing the data displayed in the table view

Post by a.gneady » 2020-08-28 12:02

I have fixed the syntax in this code now. It was actaully the code highlighting plugin we're using on our website trying to be act "smart" and fix the code :D
The corrected line is:

Code: Select all

$modField = "CONCAT('<img src=\"hooks/',`cameras`.`ratings`,'.gif\" border=\"0\" />')";
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

epano
Posts: 19
Joined: 2020-07-09 11:56

Re: Customizing the data displayed in the table view

Post by epano » 2020-08-28 15:21

Great!! 8-)
These is a great customization and anyone can make great changes in tv appearance ,
thank you ahmad :)
Attachments
Screenshot 2020-08-28 17.15.57.png
Screenshot 2020-08-28 17.15.57.png (252.61 KiB) Viewed 1654 times

Post Reply