Page 1 of 1

xBrowse - edit

Posted: Fri Jan 11, 2008 11:20 am
by StefanHaupt
Hi all,

how can I change the possibiltiy to edit a value on the fly depending on special condition ? If the condition is .t., user can edit, if it is .f. editing is not allowed. So the permission to edit changes from row to row.

oBrw:aCols[3]:nEditType := IIF (oBrw:aCols[2]= 0, EDIT_NONE, EDIT_GET)
is not working.

Posted: Fri Jan 11, 2008 11:49 am
by Antonio Linares
Stefan,

Try to use oBrowse:bChange to do it:

oBrw:bChange := { || oBrw:aCols[3]:nEditType := IIF (oBrw:aCols[2]= 0, EDIT_NONE, EDIT_GET) }

Posted: Fri Jan 11, 2008 12:12 pm
by nageswaragunupudi
How can oBrw:aCols[2] be Zero ?

Posted: Fri Jan 11, 2008 7:46 pm
by StefanHaupt
Antonio,

that´s it, it´s working perfectly :D
Thanks.


NageswaraRao,

I´m browsing an array and the value on the second position (that is the second column) is zero.
But you are right, exactly I should write Eval(oBrw:aCols[2]:bStrData)

Posted: Sat Jan 12, 2008 12:37 am
by ShumingWang
Nedittype change into block, that is very good.
obrow:acols[2]:nedittype:={||mycondition}
Some other codes change ocol:nedittype into if(valtype(ocol:nedittype)=="B",eval(ocol:nedittype),ocol:nedittype)

Regards!

Shuming Wang