Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
3f5b8a26
Commit
3f5b8a26
authored
Sep 26, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change function code style(changeAutoFilter)
parent
ec2c4849
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
78 deletions
+73
-78
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+73
-78
No files found.
cell/view/WorksheetView.js
View file @
3f5b8a26
...
...
@@ -12012,108 +12012,103 @@
}
};
WorksheetView
.
prototype
.
changeAutoFilter
=
function
(
tableName
,
optionType
,
val
)
{
// Проверка глобального лока
if
(
this
.
collaborativeEditing
.
getGlobalLock
())
{
return
;
}
WorksheetView
.
prototype
.
changeAutoFilter
=
function
(
tableName
,
optionType
,
val
)
{
// Проверка глобального лока
if
(
this
.
collaborativeEditing
.
getGlobalLock
())
{
return
;
}
if
(
true
===
window
[
'
AscCommonExcel
'
].
specialFilteringMode
)
{
if
(
true
===
window
[
'
AscCommonExcel
'
].
specialFilteringMode
)
{
return
;
}
var
t
=
this
;
var
ar
=
this
.
model
.
selectionRange
.
getLast
().
clone
();
var
t
=
this
;
var
ar
=
this
.
model
.
selectionRange
.
getLast
().
clone
();
var
onChangeAutoFilterCallback
=
function
(
isSuccess
)
{
if
(
false
===
isSuccess
)
{
t
.
handlers
.
trigger
(
"
selectionChanged
"
);
return
;
}
var
onChangeAutoFilterCallback
=
function
(
isSuccess
)
{
if
(
false
===
isSuccess
)
{
t
.
handlers
.
trigger
(
"
selectionChanged
"
);
return
;
}
switch
(
optionType
)
{
case
Asc
.
c_oAscChangeFilterOptions
.
filter
:
{
//DELETE
if
(
!
val
)
{
var
filterRange
=
null
;
var
tablePartsContainsRange
=
t
.
model
.
autoFilters
.
_isTablePartsContainsRange
(
ar
);
if
(
tablePartsContainsRange
&&
tablePartsContainsRange
.
Ref
)
{
filterRange
=
tablePartsContainsRange
.
Ref
.
clone
();
}
else
if
(
t
.
model
.
AutoFilter
)
{
filterRange
=
t
.
model
.
AutoFilter
.
Ref
;
}
switch
(
optionType
)
{
case
Asc
.
c_oAscChangeFilterOptions
.
filter
:
{
//DELETE
if
(
!
val
)
{
var
filterRange
=
null
;
var
tablePartsContainsRange
=
t
.
model
.
autoFilters
.
_isTablePartsContainsRange
(
ar
);
if
(
tablePartsContainsRange
&&
tablePartsContainsRange
.
Ref
)
{
filterRange
=
tablePartsContainsRange
.
Ref
.
clone
();
}
else
if
(
t
.
model
.
AutoFilter
)
{
filterRange
=
t
.
model
.
AutoFilter
.
Ref
;
}
if
(
null
===
filterRange
)
{
return
;
}
if
(
null
===
filterRange
)
{
return
;
}
var
deleteFilterCallBack
=
function
()
{
t
.
model
.
autoFilters
.
deleteAutoFilter
(
ar
,
tableName
);
var
deleteFilterCallBack
=
function
()
{
t
.
model
.
autoFilters
.
deleteAutoFilter
(
ar
,
tableName
);
t
.
af_drawButtons
(
filterRange
);
t
.
_onUpdateFormatTable
(
filterRange
,
false
,
true
);
}
t
.
af_drawButtons
(
filterRange
);
t
.
_onUpdateFormatTable
(
filterRange
,
false
,
true
);
};
t
.
_isLockedCells
(
filterRange
,
/*subType*/
null
,
deleteFilterCallBack
);
t
.
_isLockedCells
(
filterRange
,
/*subType*/
null
,
deleteFilterCallBack
);
}
else
//ADD ONLY FILTER
{
var
addFilterCallBack
=
function
()
{
History
.
Create_NewPoint
();
History
.
StartTransaction
();
}
else
//ADD ONLY FILTER
{
var
addFilterCallBack
=
function
()
{
History
.
Create_NewPoint
();
History
.
StartTransaction
();
t
.
model
.
autoFilters
.
addAutoFilter
(
null
,
ar
);
t
.
_onUpdateFormatTable
(
filterRange
,
false
,
true
);
t
.
model
.
autoFilters
.
addAutoFilter
(
null
,
ar
);
t
.
_onUpdateFormatTable
(
filterRange
,
false
,
true
);
History
.
EndTransaction
();
};
History
.
EndTransaction
();
};
var
filterInfo
=
t
.
model
.
autoFilters
.
_getFilterInfoByAddTableProps
(
ar
);
var
filterRange
=
filterInfo
.
filterRange
var
filterInfo
=
t
.
model
.
autoFilters
.
_getFilterInfoByAddTableProps
(
ar
);
t
.
_isLockedCells
(
filterRange
,
null
,
addFilterCallBack
)
}
t
.
_isLockedCells
(
filterInfo
.
filterRange
,
null
,
addFilterCallBack
)
}
break
;
}
case
Asc
.
c_oAscChangeFilterOptions
.
style
:
//CHANGE STYLE
{
var
changeStyleFilterCallBack
=
function
()
{
History
.
Create_NewPoint
();
History
.
StartTransaction
();
break
;
}
case
Asc
.
c_oAscChangeFilterOptions
.
style
:
//CHANGE STYLE
{
var
changeStyleFilterCallBack
=
function
()
{
History
.
Create_NewPoint
();
History
.
StartTransaction
();
//TODO внутри вызывается _isTablePartsContainsRange
t
.
model
.
autoFilters
.
changeTableStyleInfo
(
val
,
ar
,
tableName
);
t
.
_onUpdateFormatTable
(
filterRange
,
false
,
true
);
//TODO внутри вызывается _isTablePartsContainsRange
t
.
model
.
autoFilters
.
changeTableStyleInfo
(
val
,
ar
,
tableName
);
t
.
_onUpdateFormatTable
(
filterRange
,
false
,
true
);
History
.
EndTransaction
();
};
History
.
EndTransaction
();
};
var
filterRange
;
//calculate lock range and callback parameters
var
isTablePartsContainsRange
=
t
.
model
.
autoFilters
.
_isTablePartsContainsRange
(
ar
);
if
(
isTablePartsContainsRange
!==
null
)
//if one of the tableParts contains activeRange
{
filterRange
=
isTablePartsContainsRange
.
Ref
.
clone
();
}
var
filterRange
;
//calculate lock range and callback parameters
var
isTablePartsContainsRange
=
t
.
model
.
autoFilters
.
_isTablePartsContainsRange
(
ar
);
if
(
isTablePartsContainsRange
!==
null
)
//if one of the tableParts contains activeRange
{
filterRange
=
isTablePartsContainsRange
.
Ref
.
clone
();
}
t
.
_isLockedCells
(
filterRange
,
/*subType*/
null
,
changeStyleFilterCallBack
);
t
.
_isLockedCells
(
filterRange
,
/*subType*/
null
,
changeStyleFilterCallBack
);
break
;
}
}
};
break
;
}
}
};
if
(
Asc
.
c_oAscChangeFilterOptions
.
style
===
optionType
)
{
if
(
Asc
.
c_oAscChangeFilterOptions
.
style
===
optionType
)
{
onChangeAutoFilterCallback
(
true
);
}
else
{
this
.
_isLockedAll
(
onChangeAutoFilterCallback
);
}
else
{
this
.
_isLockedAll
(
onChangeAutoFilterCallback
);
}
};
};
WorksheetView
.
prototype
.
applyAutoFilter
=
function
(
autoFilterObject
)
{
var
t
=
this
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment