Passing Data from onselectrow to on_update functions.

QuestionsPassing Data from onselectrow to on_update functions.
Pedro couto asked 1 year ago

Hi Abu.

Sorry to bother you again.

Is there any way to capture all data in a row with onselectrow, and use them when on_update?

as one is a javascript function client side and the other is php server side.

What i made is save in a field of my database all the fields of the row in a json string and recover it on update, but i think this is not very elegant.

any better alternative?

as allways, thank you for your support.

best regards

2 Answers
Abu Ghufran Staff answered 1 year ago

Hello,

By default all editable fields are passed to on_update event handler and can be fetched by:

$data[“params”][“fieldname”]

You can do a print_r($data) inside the on_update and see what data is being sent from the client.

If it does not serve your requirement for some reason, let me know you scenario.

 

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Pedro Couto answered 1 year ago

Hi Again Abu.

Thank you for your quick response.

The problem is that i have to control changes and send it to a historical records.

Imagine i have a cell named “price”, i need to know the value of that cell before editind in the way that when i change the value of that cell, i have to write in another table that controls the historic of changes “Price changed from x to y”

i do this with most of the fields in the row, price, discounts, bonus, etc.

 

thak for your support, allways so kind.

Best regads

 

 

Your Answer

13 + 14 =

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?