Store selected rownum into session

QuestionsStore selected rownum into session
Chris Henderson asked 11 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 11 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 11 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 11 years ago

Hello,

Following code might solve your need.

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

Your Answer

2 + 13 =

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?