This topic is locked

open list page directly in the inline edit mode

4/27/2009 12:38:02 AM
PHPRunner General questions
L
laonian author

I used to do this in phpr 4.2:

add a record in a master table and redirect page to detail table list page in inline edit mode.
AfterAdd event for master table (4.2):

header("Location: detailtable_list.php?edit=yes&a=search&value=1&SearchFor=$values['fieldA']&SearchOption=Contains&SearchField=fieldB");

exit();


List page onload event for detail table (4.2):

// make records selected for inline editing

if ($_REQUEST["edit"]=="yes")

{

?><script>
if(!frmAdmin.elements['selection[]'].length)

frmAdmin.elements['selection[]'].checked=true;
for (i=0;i<frmAdmin.elements['selection[]'].length;++i)

frmAdmin.elements['selection[]'][i].checked=true;
$("input[@type=checkbox][@checked][@id^=check]").each(function(i){

if(!isNaN(parseInt(this.id.substr(5))))

$("a#ieditlink"+this.id.substr(5)).click();

});

</script><?php

}


The above coding combination worked perfectly for phpr 4.2 (thanks to the phpr support).
For phpr 5.0 and 5.1 beta, I used the second coding in the "Insert php snippet" event in the visual editor page, but it did not work. Actually I tried it also in list page: before display or before record processed, neither worked. I could see the records in the detail list page were selected (checkbox checked), but the "Edit selected" button is not triggered. Could the support / anybody help me with the problem? Thanks.

J
Jane 4/27/2009

Hi,
please make sure you've added this custom event at the end of page (or just after frmAdmin form).

L
laonian author 4/27/2009

please make sure you've added this custom event at the end of page (or just after frmAdmin form).


I did try to add the event at the end of the page, but had no luck. I could only see the checked checkboxes. The "Edit selected" button is not executed (clicked).
For example in phpr 5.0 build 766, the snippet was inserted right before the end of the page.

<B class=xb1></B></B></DIV>{END message_block}

<DIV></DIV>{$footer}

{END body}{$event detailtable_Snippet1} </BODY></HTML>


The end part of the view source page shows correctly the coding:

#inline_error {

font-family: Verdana, Arial, Helvetica, sans serif;

font-size: 11px;

position: absolute;

background-color: white;

border: 1px solid red;

padding: 10px;

background-repeat: no-repeat;

display: none;

}

</style><script>
if(!frmAdmin.elements['selection[]'].length)

frmAdmin.elements['selection[]'].checked=true;
for (i=0;i<frmAdmin.elements['selection[]'].length;++i)

frmAdmin.elements['selection[]'][i].checked=true;
$("input[@type=checkbox][@checked][@id^=check]").each(function(i){

if(!isNaN(parseInt(this.id.substr(5))))

$("a#ieditlink"+this.id.substr(5)).click();

});

</script> </BODY></HTML>


Please help. Thanks.

Sergey Kornilov admin 4/27/2009

I recommend to post your application to Demo Account (use 'Demo Account' button on the last screen in program). Then open a ticket at http://support.xlinesoft.com sending your Demo Account URL for investigation.