This topic is locked

How to disable 'Edit Link' in List View

1/2/2009 5:15:51 PM
PHPRunner General questions
jpedwardspost author

Hi,
In list view I have a field 'Lock' as a checkbox which the user can set as ticked using inline edit.
If it is ticked I would like the 'Edit Link' on the list page to be disabled so that the user cannot go to the full edit screen until he unticks the 'Lock' field using inline edit.
This would stop a user casually editing a record when the 'Lock' field is ticked.
How do I do this?
Regards,
JP

J
Jane 1/5/2009

Hi,
use List page: After record processed event on theEvents tab for this purpose.

Here is a sample:

if ($data["Lock"]==1)

{

$record["edit_link"] = false;

}

jpedwardspost author 1/7/2009

Hi,

use List page: After record processed event on theEvents tab for this purpose.

Here is a sample:


Thanks for this - I implemented it as:

global $record;

if ($data["freeze"]=="1")

{

$record["edit_link"] = false;
}
and it worked great.

Had to change my original field name from 'lock' to 'freeze' because lock turns out to be a mysql keyword and broke my query :-)
JP

J
joseph83 1/7/2009

How can we make same function on Asprunner pro.

J
Jane 1/8/2009

Hi,
here is a sample code for ASPRunnerPro:

if rs("FieldName")="1" then

record("edit_link") = False

end if

J
joseph83 1/8/2009

It doesn't work.
is it right code?

J
Jane 1/9/2009

Hi,
"It doesn't work" means nothing.

Please explain what doesn't work. Also make sure you have replaced FieldName with your actual field name.

J
joseph83 1/9/2009

You can see details below.


J
Jane 1/12/2009

It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.

P
polaretto 1/26/2009



Thanks for this - I implemented it as:

global $record;

if ($data["freeze"]=="1")

{

$record["edit_link"] = false;
}
and it worked great.

Had to change my original field name from 'lock' to 'freeze' because lock turns out to be a mysql keyword and broke my query :-)
JP


I want to use this code to lock / Unlock the table linked in Master Table, for example Master table contains the number of order and the sub table the order..

i want to lock the link.

It is possible? Thanks!

J
Jane 1/27/2009

Hi,
use List page: After record processedevent on the Events tab for this purpose.

Here is a sample:

$rs = CustomQuery("select Count(*) from DetailTable where DetailKey=".$data["MasterKey"]);

$data = db_fetch_numarray($rs);

if ($data[0]>10) //10 records in the detail table - lock detail link

{

$record["DetailTableName_dtable_link"] = false;

}

P
polaretto 1/27/2009

Hi,

use List page: After record processedevent on the Events tab for this purpose.

Here is a sample:


I think we aren't understand..
I've 2 table 1 named "magazzino_carichi" set as master table and the second is magazzino entrate set

as detail table. In the master table i've put a field named freeze (This is a Check box),i want to lock/unlock

te link to the detail table with the check box. I've put this code, but it don't works...
global $record;

if ($data["freeze"]=="1")

{

$record["magazzino_entrate_dtable_link"] = false;

}

J
Jane 1/28/2009

Hi,
Try to use this one:

global $record;

if ($data["freeze"])

{

$record["magazzino_entrate_dtable_link"] = false;

}