This topic is locked
[SOLVED]

 Error after green tick clicked on inline edit

4/10/2012 3:02:30 PM
PHPRunner General questions
S
scoobysteve author

I built a project and wondered if there was any known issues with the inline edit function, the normal edit works, in fact the inline edit works it makews the changes but hangs on the enlarged page with a error, if i click the black tick or hit refresh it goes back with the changes made.

S
scoobysteve author 4/10/2012

OK I have sorted this out and I think this is a bug,
IF you have a page redirect in the Edit Event after record updated it fails.
Which in my opinion is a bug because I wish to give my agents a easy access to the 2 most common editable fields and then if they need to

be more specific they used the normal edit mode but after they save I want them to be redirected back to the list page, this cant ahppen with inline edit.
BTW this happens on both PHP6.0 and 6.1
Regards

Steve

C
cgphp 4/11/2012

If you want redirect in the inline mode, enter the following code in the "Javascript onload" event of the edit page:

this.on('afterSave', function(formObj, fieldControlsArr, pageObj){

location.href = 'page_name_where_you_want_to_go.php';

});
Sergey Kornilov admin 4/11/2012

As Cristian mentions, this behavior is by design. You cannot use server side redirects in inline mode. More than that, if user opens more than one records for editing redirect will cause unsaved data loss.

S
scoobysteve author 4/11/2012



As Cristian mentions, this behavior is by design. You cannot use server side redirects in inline mode. More than that, if user opens more than one records for editing redirect will cause unsaved data loss.


I think you may have miss understood me, I think you should consider the approach that I originally had, just the normal edit mode, now this had been running

for a while and only after a long period of time did I want to use the inline edit function, BUT there had always been a redirect on the after record added in the normal edit event.
So I assumed that adding inline should have worked, I had no extra code on the events for inline edit but it did not work, it was only when I scrutinized the whole project that the events that had always been in the "after record added" in the normal edit was causing the problems.
It was an after thought I added inline on the original project that worked but it was because of the redirect on the normal edit that it failed, so now when my clients use the normal edit function there is no redirect to the list page because it would screw up the inline edit function.

Sergey Kornilov admin 4/11/2012

If you need to use redirect in "normal" edit mode only - you can do that in your AfterEdit event. Check AfterEdit event documentation that explains how to figure out which mode you currently in (inline vs normal edit page).
Make redirect conditional based on the current edit mode.

S
scoobysteve author 4/12/2012



If you need to use redirect in "normal" edit mode only - you can do that in your AfterEdit event. Check AfterEdit event documentation that explains how to figure out which mode you currently in (inline vs normal edit page).
Make redirect conditional based on the current edit mode.


OK Thanks I will do that.