作成日: 2018/04/04 最終更新日: 2018/04/04
文書種別
使用方法
詳細
Excelフィルタリングでは、「すべて選択」や「~からフィルタをクリア」でフィルタ解除した場合、内部的にはフィルタの実行ではなくリセットとみなされるため、AutoFilteringColumn/AutoFilteredColumnイベントは発生しません。
フィルタ解除時にイベントを発生させるには、クライアント側でフィルタの解除を取得してCallBackでサーバー側に通知してください。
◎サンプルコード(VB)
◎サンプルコード(C#)
フィルタ解除時にイベントを発生させるには、クライアント側でフィルタの解除を取得してCallBackでサーバー側に通知してください。
◎サンプルコード(VB)
------------------------
Webフォームクラス
------------------------
Protected Sub FpSpread1_ButtonCommand(sender As Object, e As FarPoint.Web.Spread.SpreadCommandEventArgs) Handles FpSpread1.ButtonCommand
If e.CommandName = "FilterResetting" Then
・・・
End If
If e.CommandName = "FilterReset" Then
・・・
End If
End Sub
------------------------
クライアント側スクリプト
------------------------
<script type="text/javascript">
document.onreadystatechange = function () {
if (document.readyState == "complete") {
var spread = document.getElementById("FpSpread1");
if (spread.addEventListener) {
spread.addEventListener("CallBackStart", CallBackStart, false);
spread.addEventListener("CallBackStopped", CallBackStopped, false);
}
}
}
function CallBackStart(e) {
if (e.command == "Filter$reset") {
var spread = document.getElementById("FpSpread1");
spread.CallBack("FilterResetting");
}
}
function CallBackStopped(e) {
if (e.command == "Filter$reset") {
var spread = document.getElementById("FpSpread1");
spread.CallBack("FilterReset");
}
}
</script>
Webフォームクラス
------------------------
Protected Sub FpSpread1_ButtonCommand(sender As Object, e As FarPoint.Web.Spread.SpreadCommandEventArgs) Handles FpSpread1.ButtonCommand
If e.CommandName = "FilterResetting" Then
・・・
End If
If e.CommandName = "FilterReset" Then
・・・
End If
End Sub
------------------------
クライアント側スクリプト
------------------------
<script type="text/javascript">
document.onreadystatechange = function () {
if (document.readyState == "complete") {
var spread = document.getElementById("FpSpread1");
if (spread.addEventListener) {
spread.addEventListener("CallBackStart", CallBackStart, false);
spread.addEventListener("CallBackStopped", CallBackStopped, false);
}
}
}
function CallBackStart(e) {
if (e.command == "Filter$reset") {
var spread = document.getElementById("FpSpread1");
spread.CallBack("FilterResetting");
}
}
function CallBackStopped(e) {
if (e.command == "Filter$reset") {
var spread = document.getElementById("FpSpread1");
spread.CallBack("FilterReset");
}
}
</script>
◎サンプルコード(C#)
-------------------------------
Webフォームクラス
-------------------------------
protected void FpSpread1_ButtonCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e) {
if ((e.CommandName == "FilterResetting")) {
・・・
}
if ((e.CommandName == "FilterReset")) {
・・・
}
}
------------------------
クライアント側スクリプト
------------------------
※VBのサンプルコードと同様
Webフォームクラス
-------------------------------
protected void FpSpread1_ButtonCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e) {
if ((e.CommandName == "FilterResetting")) {
・・・
}
if ((e.CommandName == "FilterReset")) {
・・・
}
}
------------------------
クライアント側スクリプト
------------------------
※VBのサンプルコードと同様
旧文書番号
41722