diff options
author | xuri <xuri.me@gmail.com> | 2018-09-01 23:36:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-01 23:36:57 +0800 |
commit | ba459dc659720d7504e5eb6f5bda9081a452a509 (patch) | |
tree | 774757d7002fe535eba896377e2d3258923cf2d8 | |
parent | 562ba3d234489796b94aca01eda88aea7b0c5cbf (diff) |
DataValidation struct changed
Change `allowBlank`, `ShowErrorMessage` and `ShowInputMessage` type as boolean, add new field `ShowDropDown`, change fields orders follow as ECMA-376-1:2016 18.3.1.32.
-rw-r--r-- | xmlWorksheet.go | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/xmlWorksheet.go b/xmlWorksheet.go index 25e3904..7cf4994 100644 --- a/xmlWorksheet.go +++ b/xmlWorksheet.go @@ -301,20 +301,23 @@ type xlsxDataValidations struct { DataValidation []*DataValidation `xml:"dataValidation"` } +// DataValidation directly maps the a single item of data validation defined +// on a range of the worksheet. type DataValidation struct { - AllowBlank string `xml:"allowBlank,attr"` // allow empty - ShowInputMessage string `xml:"showInputMessage,attr"` // 1, true,0,false, select cell, Whether the input message is displayed - ShowErrorMessage string `xml:"showErrorMessage,attr"` // 1, true,0,false, input error value, Whether the error message is displayed - ErrorStyle *string `xml:"errorStyle,attr"` //error icon style, warning, infomation,stop - ErrorTitle *string `xml:"errorTitle,attr"` // error title - Operator string `xml:"operator,attr"` // - Error *string `xml:"error,attr"` // input error value, notice message - PromptTitle *string `xml:"promptTitle"` + AllowBlank bool `xml:"allowBlank,attr"` + Error *string `xml:"error,attr"` + ErrorStyle *string `xml:"errorStyle,attr"` + ErrorTitle *string `xml:"errorTitle,attr"` + Operator string `xml:"operator,attr"` Prompt *string `xml:"prompt,attr"` - Type string `xml:"type,attr"` //data type, none,custom,date,decimal,list, textLength,time,whole - Sqref string `xml:"sqref,attr"` //Validity of data validation rules, cell and range, eg: A1 OR A1:A20 - Formula1 string `xml:"formula1"` // data validation role - Formula2 string `xml:"formula2"` //data validation role + PromptTitle *string `xml:"promptTitle"` + ShowDropDown bool `xml:"showDropDown,attr"` + ShowErrorMessage bool `xml:"showErrorMessage,attr"` + ShowInputMessage bool `xml:"showInputMessage,attr"` + Sqref string `xml:"sqref,attr"` + Type string `xml:"type,attr"` + Formula1 string `xml:"formula1"` + Formula2 string `xml:"formula2"` } // xlsxC directly maps the c element in the namespace |