This topic is locked
[SOLVED]

 Readonly field on list page during inline edit mode

7/9/2018 9:31:36 AM
ASPRunnerPro General questions
A
abdemir author

Hi,
I need user based field control inline edit mode (readonly or not), however until now I could not success with below two codes. If will be happy if you help me please.
ROLES

Sales Rep. : Warehouse and Delivery fields should be ReadOnly.

Sales Manager: No restriction (ReadOnly) on Warehouse and Delivery fields.
FIED NAMES

Warehouse (combo)

Delivery (textbox)
FIRST SOLUTION; (please see attached result file)

  1. List View > Before Display

    If session("myRole") = "Sales Rep" Then

    pageObject.readOnlyFields("Warehouse")

    End If
    SECOND SOLUTION;
  2. List View > JavaScript

    var ctrlWH = Runner.getControl(pageid,'Warehouse');

    if (myAuth=='Sales Rep')

    {

    ctrlWH.makeReadonly();

    }
    Snippet Area:

    Response.write "<script> window.myAuth = '" & Session("myRole") & "'</script>"
    Note: Session("myRole") is defined during login process.

    ASPRunner version 9.1
    Screenshot pictures;

    https://ibb.co/iUjx98

    https://ibb.co/dfy2bo

admin 7/9/2018

On List page all fields are readonly. If you need to change inline edit page behaviour you need to add your code to Edit page events.

A
abdemir author 7/9/2018

JavaScript solution worked on edit events. thank you.