Session on Subgrid problem

QuestionsSession on Subgrid problem
Andre asked 7 years ago

Dear Abu,
I have integrated PHPGrid into CI Framework, but I have problem on session when using subgrid. I have 3 levels subgrid, I named main-grid, subgrid-1, subgrid-2.

These are the steps:

Step 1 : I click + (plus) button on main-grid, subgrid-1 will displayed. Then I declare $_SESSION['rowid_number'] = $_REQUEST['id']; Let say the $_REQUEST['id'] value is 1
Step 2 : Echo $_SESSION['rowid_number']; //Printed is 1.
Step 3 : I click + (plus) button on main-subgrid-1, subgrid-2 will displayed
Step 4 : Echo $_SESSION['rowid_number']; //Printed is blank

Why Step 4 is malfunction? As I know, all session variables can be known in all the pages of the website. Could you help me please?

6 Answers
Abu Ghufran answered 7 years ago

Looks like session is not started on subgrid-2.
Make sure session_start() is called on page start.

Cristian Engelmann answered 6 years ago

My problem is:

Step 1: I click + (plus) button on main-grid, subgrid-1 will displayed.
It is Ok when the rowid is number or charter 'screw2' field. But when charter is 'screw21/2' field will display nothing.

My e-mails is [email protected] and [email protected]

Thank you.

Abu Ghufran answered 6 years ago

The first field must be unique and alpha numeric.
It is required for JS operations.

You can use some string functions in sql select command to make it alpha numeric.

Cristian Engelmann answered 6 years ago

I show my code

$c_id = $_REQUEST["rowid"];

if $c_id = 'ACPALU' the subgrig show me information.
But if $c_id = 'ACPALU3/4' the subgrig not show me information.

I use PHP Version 5.4.7 and MySQL 5.5. And if I use the query on mysql, the answer is good in both.

$grid->select_command = "select a.codigo_familiaE, a.fecha_ingreso, e.descripcion,(a.codigo_familiaA) AS cod, (SELECT eea.descripcion FROM equipos_arriendo AS eea WHERE eea.codigo_familia = a.codigo_familiaA) AS descr
FROM accesorioUequipos_arriendo a INNER JOIN equipos_arriendo e ON e.codigo_familia = a.codigo_familiaE
WHERE a.codigo_familiaA = '".$c_id."'";

Cristian Engelmann answered 6 years ago

I found it.
Step 1: I click + (plus) button on main-grid, subgrid-1 will displayed.

The problema is when maingrid' rowid is 'ACPALU3/4' and it is to send rowid blank.
The problema is the +(plus) function.
Why ?

Thank you, again.

Abu Ghufran answered 6 years ago

Basically, it uses javascript code to generate subgrid and set it's table id based on row id.
When it has some special character (e.g. /) the lib skips it to avoid js error.
It is recommended to use only alpha numeric as first column of grid to avoid any issue with row id.

Your Answer

3 + 9 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?