Measurement rapid Development platform in the construction of grid parts, there are such requirements, such as the grid in accordance with the condition "not audited" data, this line can be edited, "audited" data, this row of data cannot be modified. This requirement is also a lot in the daily construction. We know that there are two familiar methods to control the reading and writing of the grid parts in the rapid development platform of measurement.
Mesh Parts 1. Read-only =true
Mesh Parts 1. Read-only =false
This is the overall control of whether the mesh parts can be written or read-only, need to be placed in the grid Part 1. RefreshData () before the effect.
Grid Part 1. Setfieldreadonly ("Field name", True)
Grid Part 1. Setfieldreadonly ("Field name", False)
This can be set to specify whether the field can be written or read only, after the mesh parts refresh is also effective.
If we set the grid assembly directly to 1. Setfieldreadonly ("Field name", False), all the rows in this column can be edited, then set according to a certain condition, not peers can edit, how to do?
very simply, we can trigger in the focus cell event of the grid, set those fields to allow read and write, and then simulate the read/write control that is not in line with a certain condition.
Example:
650) this.width=650; "id=" aimg_746 "src=" http://bbs.delit.cn/data/attachment/forum/201512/14/ 120913r5vqhvd6z6wvvjse.jpg.thumb.jpg "alt=" 120913r5vqhvd6z6wvvjse.jpg.thumb.jpg "/>
' The data of the non-approved row can be modified.
if grid Part 1. Getfocusedrowvalue ("ZIDUAN1") = "not audited" then
Call ("writable")
Else
Call ("Read Only")
End If
----------------------------------------------------------
Read Only:
Grid Part 1. Setfieldreadonly ("ZIDUAN1", True)
Grid Part 1. Setfieldreadonly ("ZIDUAN2", True)
Grid Part 1. Setfieldreadonly ("ZIDUAN3", True)
-------------------------------------------------------
Read and write:
Grid Part 1. Setfieldreadonly ("ZIDUAN1", False)
Grid Part 1. Setfieldreadonly ("ZIDUAN2", False)
Grid Part 1. Setfieldreadonly ("ZIDUAN3", False)
Original address: http://bbs.delit.cn/thread-466-1-1.html
Reprint please specify the source:
Author: metric Technology http://www.delit.cn
A reference example in a grid part that sets whether an entire row is editable based on the conditions of one column