A reference example in a grid part that sets whether an entire row is editable based on the conditions of one column

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.