Topic: Integration with gridphp.com

Hello
I was trying to integrate gridphp.com in FA.

Facing this error. May be some JS is conflicting. Can anyone help?

https://prnt.sc/1zvrs70

www.boxygen.pk

Re: Integration with gridphp.com

Basically I don't have idea about gridphp. But it looks the entire fa html content comes in the alert.. So it looks you are looking the js wrong way.

Subscription service based on FA
HRM CRM POS batch Themes

Re: Integration with gridphp.com

Lightweight AjaxCRUD is superb to integrate too.

Re: Integration with gridphp.com

Hello all,
I was able to integrate this.
Download gridphp.com and add it to the root folder of FA.

Copy the following code in the page where you want to show the Grid and set the $path_to_root with respect to the location of file.

<?php
/**
 * PHP Grid Component
 *
 * @author Abu Ghufran <gridphp@gmail.com> - http://www.phpgrid.org
 * @version 2.0.0
 * @license: see license.txt included in package
 */
 $page_security = 'SA_OPEN';
 $path_to_root="../..";
 include($path_to_root . "/includes/session.inc");

add_css_file($path_to_root."/gridphp/lib/js/themes/redmond/jquery-ui.custom.css");
add_css_file($path_to_root."/gridphp/lib/js/jqgrid/css/ui.jqgrid.css");
add_js_ufile($path_to_root."/gridphp/lib/js/jquery.min.js");
add_js_ufile($path_to_root."/gridphp/lib/js/jqgrid/js/i18n/grid.locale-en.js");
add_js_ufile($path_to_root."/gridphp/lib/js/jqgrid/js/jquery.jqGrid.min.js");
add_js_ufile($path_to_root."/gridphp/lib/js/themes/jquery-ui.custom.min.js");

// include and create object
include_once ($path_to_root."/gridphp/lib/inc/jqgrid_dist.php");

$server = $db_connections[user_company()]['host'];
$user = $db_connections[user_company()]['dbuser'];
$password = $db_connections[user_company()]['dbpassword'];
$database = $db_connections[user_company()]['dbname'];

$db_conf = array(
                    "type"         => 'mysqli',
                    "server"     => $server,
                    "user"         => $user,
                    "password"     => $password,
                    "database"     => $database
                );


$g = new jqgrid($db_conf);

$grid["rowNum"] = 10; // by default 20
$grid["sortname"] = 'id'; // by default sort grid by this field
$grid["caption"] = "Invoice Data"; // caption of grid
$grid["autowidth"] = false; // expand grid to screen width
$grid["multiselect"] = true; // allow you to multi-select through checkboxes
$grid["form"]["position"] = "center";
$grid["shrinkToFit"] = false;

$g->set_options($grid);

$g->set_actions(array(
                        "add"=>true, // allow/disallow add
                        "edit"=>true, // allow/disallow edit
                        "delete"=>true, // allow/disallow delete
                        "view"=>true, // allow/disallow delete
                        "rowactions"=>true, // show/hide row wise edit/del/save option
                        "search" => "advance", // show single/multi field search condition (e.g. simple or advance)
                        "showhidecolumns" => false
                    )
                );

$g->select_command = "SELECT * FROM dimensions where id < 85";

$g->table = "dimensions";

// this db table will be used for add,edit,delete
$g->table = "invheader";

// pass the cooked columns to grid
$g->set_columns($cols);

// generate grid output, with unique grid name as 'list1'
$out = $g->render("list1");
page(_($help_context = "Dimensions"), false);
echo '<div style="margin:10px">';
echo $out;
div_end();
end_page();
?>
www.boxygen.pk

Re: Integration with gridphp.com

In order to get GridPHP work in FA as expected I needed to comment out following line in session.inc

html_cleanup($_GET);
html_cleanup($_POST);
// html_cleanup($_REQUEST);
html_cleanup($_SERVER);

What could be the adverse affect of this?

www.boxygen.pk

Re: Integration with gridphp.com

This is just html decoding ,

Is there any more detail like what happens when you try it html clean

Subscription service based on FA
HRM CRM POS batch Themes