Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web-apps
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
web-apps
Commits
d5df1f43
Commit
d5df1f43
authored
Dec 13, 2016
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SSE] Select data ranges for sparklines.
parent
6c75dbab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
8 deletions
+85
-8
apps/spreadsheeteditor/main/app/view/CellRangeDialog.js
apps/spreadsheeteditor/main/app/view/CellRangeDialog.js
+3
-3
apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js
apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js
+82
-5
No files found.
apps/spreadsheeteditor/main/app/view/CellRangeDialog.js
View file @
d5df1f43
...
...
@@ -112,17 +112,17 @@ define([
if
(
settings
.
api
)
{
me
.
api
=
settings
.
api
;
me
.
api
.
asc_setSelectionDialogMode
(
Asc
.
c_oAscSelectionDialogType
.
Chart
,
settings
.
range
?
settings
.
range
:
''
);
me
.
api
.
asc_setSelectionDialogMode
(
settings
.
type
,
settings
.
range
?
settings
.
range
:
''
);
me
.
api
.
asc_unregisterCallback
(
'
asc_onSelectionRangeChanged
'
,
_
.
bind
(
me
.
onApiRangeChanged
,
me
));
me
.
api
.
asc_registerCallback
(
'
asc_onSelectionRangeChanged
'
,
_
.
bind
(
me
.
onApiRangeChanged
,
me
));
Common
.
NotificationCenter
.
trigger
(
'
cells:range
'
,
Asc
.
c_oAscSelectionDialogType
.
Chart
);
Common
.
NotificationCenter
.
trigger
(
'
cells:range
'
,
settings
.
type
);
}
me
.
inputRange
.
validation
=
function
(
value
)
{
if
(
settings
.
validation
)
{
return
settings
.
validation
.
call
(
me
,
value
);
}
else
{
var
isvalid
=
me
.
api
.
asc_checkDataRange
(
Asc
.
c_oAscSelectionDialogType
.
Chart
,
value
,
false
);
var
isvalid
=
me
.
api
.
asc_checkDataRange
(
settings
.
type
,
value
,
false
);
return
(
isvalid
==
Asc
.
c_oAscError
.
ID
.
DataRangeError
)
?
me
.
txtInvalidRange
:
true
;
}
};
...
...
apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js
View file @
d5df1f43
...
...
@@ -94,6 +94,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this
.
horAxisProps
=
null
;
this
.
currentAxisProps
=
null
;
this
.
dataRangeValid
=
''
;
this
.
sparkDataRangeValid
=
''
;
this
.
dataLocationRangeValid
=
''
;
this
.
currentChartType
=
this
.
_state
.
ChartType
;
this
.
storageName
=
(
this
.
isChart
)
?
'
sse-chart-settings-adv-category
'
:
'
sse-spark-settings-adv-category
'
;
},
...
...
@@ -853,7 +855,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this
.
btnSelectSparkData
=
new
Common
.
UI
.
Button
({
el
:
$
(
'
#spark-dlg-btn-data
'
)
});
// this.btnSelectSparkData.on('click', _.bind(this.onSelect
Data, this));
this
.
btnSelectSparkData
.
on
(
'
click
'
,
_
.
bind
(
this
.
onSelectSpark
Data
,
this
));
this
.
txtSparkDataLocation
=
new
Common
.
UI
.
InputField
({
el
:
$
(
'
#spark-dlg-txt-location
'
),
...
...
@@ -865,11 +867,10 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
});
this
.
btnSelectLocationData
=
new
Common
.
UI
.
Button
({
el
:
$
(
'
#spark-dlg-btn-data
'
)
el
:
$
(
'
#spark-dlg-btn-
location-
data
'
)
});
// this.btnSelectLocationData.on('click', _.bind(this.onSelect
Data, this));
this
.
btnSelectLocationData
.
on
(
'
click
'
,
_
.
bind
(
this
.
onSelectLocation
Data
,
this
));
this
.
_arrEmptyCells
=
[
{
value
:
Asc
.
c_oAscEDispBlanksAs
.
Gap
,
displayValue
:
this
.
textGaps
},
{
value
:
Asc
.
c_oAscEDispBlanksAs
.
Zero
,
displayValue
:
this
.
textZero
},
...
...
@@ -1375,6 +1376,24 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
if
(
value
&&
value
.
length
==
2
)
{
this
.
txtSparkDataRange
.
setValue
((
value
[
0
])
?
value
[
0
]
:
''
);
this
.
txtSparkDataLocation
.
setValue
((
value
[
1
])
?
value
[
1
]
:
''
);
this
.
sparkDataRangeValid
=
value
[
0
];
this
.
txtSparkDataRange
.
validation
=
function
(
value
)
{
if
(
_
.
isEmpty
(
value
))
return
true
;
var
isvalid
=
me
.
api
.
asc_checkDataRange
(
Asc
.
c_oAscSelectionDialogType
.
Chart
,
value
,
false
);
return
(
isvalid
==
Asc
.
c_oAscError
.
ID
.
DataRangeError
)
?
me
.
textInvalidRange
:
true
;
};
this
.
dataLocationRangeValid
=
value
[
1
];
this
.
txtSparkDataLocation
.
validation
=
function
(
value
)
{
if
(
_
.
isEmpty
(
value
))
return
true
;
var
isvalid
=
me
.
api
.
asc_checkDataRange
(
Asc
.
c_oAscSelectionDialogType
.
FormatTable
,
value
,
false
);
return
(
isvalid
==
Asc
.
c_oAscError
.
ID
.
DataRangeError
)
?
me
.
textInvalidRange
:
true
;
};
}
this
.
_changedProps
=
new
Asc
.
sparklineGroup
();
...
...
@@ -1478,7 +1497,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
win
.
setSettings
({
api
:
me
.
api
,
isRows
:
(
me
.
cmbDataDirect
.
getValue
()
==
0
),
range
:
(
!
_
.
isEmpty
(
me
.
txtDataRange
.
getValue
())
&&
(
me
.
txtDataRange
.
checkValidate
()
==
true
))
?
me
.
txtDataRange
.
getValue
()
:
me
.
dataRangeValid
range
:
(
!
_
.
isEmpty
(
me
.
txtDataRange
.
getValue
())
&&
(
me
.
txtDataRange
.
checkValidate
()
==
true
))
?
me
.
txtDataRange
.
getValue
()
:
me
.
dataRangeValid
,
type
:
Asc
.
c_oAscSelectionDialogType
.
Chart
});
}
},
...
...
@@ -1495,6 +1515,63 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
}
},
onSelectSparkData
:
function
()
{
var
me
=
this
;
if
(
me
.
api
)
{
var
handlerDlg
=
function
(
dlg
,
result
)
{
if
(
result
==
'
ok
'
)
{
me
.
sparkDataRangeValid
=
dlg
.
getSettings
();
me
.
txtSparkDataRange
.
setValue
(
me
.
sparkDataRangeValid
);
me
.
txtSparkDataRange
.
checkValidate
();
}
};
var
win
=
new
SSE
.
Views
.
CellRangeDialog
({
handler
:
handlerDlg
}).
on
(
'
close
'
,
function
()
{
me
.
show
();
});
var
xy
=
me
.
$window
.
offset
();
me
.
hide
();
win
.
show
(
xy
.
left
+
160
,
xy
.
top
+
125
);
win
.
setSettings
({
api
:
me
.
api
,
range
:
(
!
_
.
isEmpty
(
me
.
txtSparkDataRange
.
getValue
())
&&
(
me
.
txtSparkDataRange
.
checkValidate
()
==
true
))
?
me
.
txtSparkDataRange
.
getValue
()
:
me
.
sparkDataRangeValid
,
type
:
Asc
.
c_oAscSelectionDialogType
.
Chart
});
}
},
onSelectLocationData
:
function
()
{
var
me
=
this
;
if
(
me
.
api
)
{
var
handlerDlg
=
function
(
dlg
,
result
)
{
if
(
result
==
'
ok
'
)
{
me
.
dataLocationRangeValid
=
dlg
.
getSettings
();
me
.
txtSparkDataLocation
.
setValue
(
me
.
dataLocationRangeValid
);
me
.
txtSparkDataLocation
.
checkValidate
();
}
};
var
win
=
new
SSE
.
Views
.
CellRangeDialog
({
handler
:
handlerDlg
}).
on
(
'
close
'
,
function
()
{
me
.
show
();
});
var
xy
=
me
.
$window
.
offset
();
me
.
hide
();
win
.
show
(
xy
.
left
+
160
,
xy
.
top
+
125
);
win
.
setSettings
({
api
:
me
.
api
,
range
:
(
!
_
.
isEmpty
(
me
.
txtSparkDataLocation
.
getValue
())
&&
(
me
.
txtSparkDataLocation
.
checkValidate
()
==
true
))
?
me
.
txtSparkDataLocation
.
getValue
()
:
me
.
dataLocationRangeValid
,
type
:
Asc
.
c_oAscSelectionDialogType
.
FormatTable
});
}
},
show
:
function
()
{
Common
.
Views
.
AdvancedSettingsWindow
.
prototype
.
show
.
apply
(
this
,
arguments
);
...
...
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