Jump to content

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


benoitclaeys

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

Link to comment
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;

 

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...