Store selected rownum into session

QuestionsStore selected rownum into session
Chris Henderson asked 6 years ago

Abu,

I want to store the user's selected rownum into the session variable, how can I go about this?

Thanks,

Chris

3 Answers
Abu Ghufran answered 6 years ago

Hello,

You can get JS callback of row selection (refer editing/custom-events.php) js_on_select_row.
And then in function you can write some ajax call to send selected ID on php side and save it in session.

Regards,

Chris Henderson answered 6 years ago

Sorry,

I don't think I explained very well, it is the number of records displayed in the grid which I believe is saved in RowNum that I am after.

E.g. If I have the selections set to –

$grid["rowList"] = array(50,100,200);

with a default of –

$grid["rowNum"] = 50;

If the user changes it to 100, I want to save the 100 in session to use the next time the user goes to the page.

Thanks,

Chris

Abu Ghufran answered 6 years ago

Hello,

Following code might solve your need.

if (!empty($_GET["rowNum"]))
$grid["rowNum"] = $_GET["rowNum"];
else
$grid["rowNum"] = 50;

Your Answer

12 + 12 =

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 / 5. Vote count:

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

Let us improve this post!