Jump to content
uniGUI Discussion Forums
benoitclaeys

DBGrid How can I set Rows in read-only depending on a column value ?

Recommended Posts

Hello,

Want to allow edition of somes rows in a uniDBGrid, other ones must stay in read only. (for a Column, it' easy)

The Read only condition on a row must be driven by one column value of the row.

it's certainly done be aborting edition mode in a ExtJS event with a test on a value in a column... but I do not see how...

Regards

Share this post


Link to post
Share on other sites

here is 2 example for second column.

 

with UniDBGrid1, JSInterface do
  begin
    JSAddListener('beforeedit', JSFunction('editor, e',' if (e.colIdx === 1){return false;}  return true; '));
  end;

  with UniDBGrid1, JSInterface do
  begin
    JSAddListener('beforeedit', JSFunction('editor, e',' if (e.record.get("1") === "Lee"){return false;}  return true; '));
  end;

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×