| Subject |
Re: How to make a record conditional uneditable in a Grid |
| From |
Gaetano D. <gaetanoddRemoveThis@andThatHotmail.com> |
| Date |
Thu, 5 Aug 2021 17:52:16 +1000 |
| Newsgroups |
dbase.getting-started |
Hi Milind,
Theoretically, if the datepicker works despite the canEdit event has
fired, it mean the row is not yet set to edit mode before the datepicker
code executes, else the event would fire and the msgbox would be
displayed, but that is only a guess. I am not familiar with the
datepicker so I cannot be of much help with that.
Cheers,
Gaetano.
On 5/08/2021 12:35, Milind Nighojkar wrote:
> Hi Gaetano ,
>
> Thanks it worked..
>
> However I observed one thing for dropdown or for the date fields having datepicker it does not work meaning still we can edit the fields....
>
> Any pointers?
>
> Regards
>
> Milind Nighojkar
>
>> On 4/08/2021 04:57, Milind Nighojkar wrote:
>>> Scenerio :
>>> In a Grid I want to conditionally make record uneitable based on value of a field in that record say field 'status' having value 'Completed'
>>> Any suggestions?
>>>
>>> Milind Nighojkar
>> Hi Milind,
>>
>> When the rowset's autoedit property is set to true and you start editing
>> a field in a grid, the beginEdit() event is automatically fired and so
>> is the canEdit() event after that. Try to add the check for your
>> conditions in the canEdit event and return false or true as needed with
>> an IF/ENDIF block
>>
>> function query1_canEdit
>>
>> local bEdit
>>
>> bEdit=true
>>
>> if form.rowset.fields["status"].value.tolowercase()<>completed"
>>
>> bEdit=false
>>
>> msgbox("Cannot edit this fields as the status is not completed")
>>
>> endif
>>
>> return bEdit
>>
>> --
>> Gaetano.
>>
--
Gaetano.
|
|