Making specific lines in a datagrid uneditable

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Making specific lines in a datagrid uneditable

Postby alasdairs » Fri Apr 05, 2024 1:19 pm

Hi all,

I was wondering whether it's possible to set some rows of a datagrid to uneditable depending on one of their fields in the database. One of the datagrids in my application is for incoming stock, and once the stock is checked, it needs to become uneditable. I would rather not use something like this:
Code: Select all
function onCellDoubleClick(foundsetindex, columnindex, record, event) {
   if (record.checked) {
      elements.table.stopCellEditing()
   }
}

because it feels a little clunky. Is there any way I can do this without stopCellEditing()?

Thanks,
Alasdair
Software Engineer
alasdairs
 
Posts: 46
Joined: Wed Dec 27, 2023 10:06 pm
Location: The Internet

Re: Making specific lines in a datagrid uneditable

Postby rafig » Fri Apr 05, 2024 1:57 pm

Hi
there is an
Code: Select all
isEditableDataprovider

property for each column in a grid that you can assign a calculation field to, which could be set based on your criteria...
Servoy Certified Developer
Image
rafig
 
Posts: 708
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK


Return to Programming with Servoy

Who is online

Users browsing this forum: Bing [Bot] and 6 guests

cron