This topic is locked
[SOLVED]

 Event after record add for inline edit

11/19/2012 2:31:08 PM
PHPRunner General questions
W
wildwally author

I have a list page that I allow the user to inline edit 1 field for each record, is there a working example of how to insert a record into another table if the inline edit value matches a certain contition?
Looking through the manual, it looks like it's possible - just can't find a example of how to evaluate the field on a repetitive basis.
Thanks in advance.

C
cgphp 11/19/2012

Check this article: http://xlinesoft.com/phprunner/docs/insert_a_record_into_another_table.htm
Surround the query with an if statement to evaluate the condition.

W
wildwally author 11/19/2012

I might not have been clear in my question, sorry. I have no problem uderstand how to add record - my question is more around evaluating the selection when inline edit is concerned with multiple records.
if($inline ($value['myfield']=='compared value'))
{
//so on
This is what I need assistance on.

W
wildwally author 11/27/2012

Still looking for some assistance with this.

  1. What event on the list page should the code go to evaluate the inline edited value?
  2. Is there anything special that needs to take place to read the new value?
    As I stated above I have a list page with only one field set for inline edit. If the user changes the value for the job status to lost, I want to add a record to another table containing some of the data from the row the user changed the status of.

Sergey Kornilov admin 11/27/2012

You need to use AfterEdit event. According to the manual you can use $values and $oldvalues arrays to access old and new values of any given field:

http://xlinesoft.com/phprunner/docs/after_record_updated.htm

W
wildwally author 11/28/2012



You need to use AfterEdit event. According to the manual you can use $values and $oldvalues arrays to access old and new values of any given field:

http://xlinesoft.com...ord_updated.htm


So if I select multiple items from the list and inline edit them and save all changes the code reads the after edit event from the edit page for each or does it require a loop?
Do I do this for inline?


if($inline == True)
{
//My Code......
}
Sergey Kornilov admin 11/28/2012

It doesn't require a loop. AfterEdit event will called for each record separately.