/* Note: inputtype must be set to 4 */ $objGrid->FormatColumn("lastname", "Text link", "30", "30", "4", "100", "left", "link:updatepicture(%s%s%s),id,name,lastname"); $objGrid->FormatColumn("age", "Age", 5, 5, 0, "50", "right"); $objGrid->FormatColumn("afiliation", "Afiliation Date", 10, 10, 0, "100", "center", "date:dmy:/"); $objGrid->FormatColumn("status", "Status", 5, 5, 0, "60", "left", "select:1_Single:2_Married:3_Divorced"); $objGrid->FormatColumn("active", "Active", 2, 2, 0, "50", "center", "check:No:Yes"); $objGrid->FormatColumn("salary", "Salary", 10, 10, 0, "90", "right", "2"); $objGrid->FormatColumn("workeddays", "Work days", 5, 2, 0, "50", "right", "integer"); $objGrid->FormatColumn("calc_1", "Value Days", "10", "10", "3", "70", "right", "calc:((salary/30)*workeddays)"); /* Dynamic image: Displaying an image link with a value stored in a field */ /* Note: The %s in the image name will be replaced by the selected field, in this example by photo field */ $objGrid->FormatColumn("photo", "Photo", "25", "0", "0", "150", "center", "imagelink:images/sample/%s:updatepicture(%s%s%s),id,name,lastname"); /* Static image: Displaying an image link with an unique name */ /* Note: inputtype must be set to 3 */ $objGrid->FormatColumn("image_1", "Img", "25", "0", "3", "20", "center", "imagelink:images/sample/money.png:updatepicture(%s%s%s),id,name,lastname"); $objGrid->where("active = '1'"); $objGrid->setHeader(); ?> <!-- /* Sample Script to execute when user click over the photo link */ --> <script type="text/javascript"> function updatepicture( code, name, lastname ){ alert ("SAMPLE SCRIPT\n\nHere must go a process to update the picture or something else for:\n\nRecord ID:"+code+ "\nName: "+ name + "\nLast name: "+ lastname ); } </script> </head> <body> <?php