Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitab776ef

Browse files
authored
Merge pull request#1480 from Bene-Graham/fix-bug-1027
Fixed undefined ref error when setting a data validation that is a range of cells at the worksheet level
2 parentsebb31f2 +02c7dab commitab776ef

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

‎lib/xlsx/xform/sheet/data-validations-xform.js‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ function optimiseDataValidations(model) {
5151
returndvList
5252
.map(dv=>{
5353
if(!dv.marked){
54-
constaddr=colCache.decodeAddress(dv.address);
54+
constaddr=colCache.decodeEx(dv.address);
55+
if(addr.dimensions){
56+
dvMap[addr.dimensions].marked=true;
57+
return{
58+
...dv.dataValidation,
59+
sqref:dv.address,
60+
};
61+
}
5562

5663
// iterate downwards - finding matching cells
5764
letheight=1;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
constExcelJS=verquire('exceljs');
2+
3+
constTEST_XLSX_FILE_NAME='./spec/out/wb.test.xlsx';
4+
5+
describe('github issues',()=>{
6+
it('issue 1027 - Broken due to Cannot set property \'marked\' of undefined error',()=>{
7+
constwb=newExcelJS.Workbook();
8+
constws=wb.addWorksheet('Sheet1');
9+
10+
constrange='A2:A1048576';
11+
12+
ws.dataValidations.model[range]={
13+
allowBlank:true,
14+
error:'Please use the drop down to select a valid value',
15+
errorTitle:'Invalid Selection',
16+
formulae:['"Apples,Bananas,Oranges"'],
17+
showErrorMessage:true,
18+
type:'list',
19+
};
20+
21+
returnwb.xlsx.writeFile(TEST_XLSX_FILE_NAME);
22+
});
23+
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp