反饋已提交
網絡繁忙
和 10.0 差別:
新增 addEffect API
方法
addEffect(type, opts)
滑鼠點選或者懸浮時,儲存格或所在列字體變化。
參數
type: string,
opts: {
style: {
bold: boolean,
italic: boolean,
fontFamily: string,
strikeThrough: boolean,
fontSize: number,
subscript: boolean,
underLine: {
width: number
style: string,
color: number
},
textShadow: boolean,
supscript: boolean,
trigger: string,
single: boolean
}
type:變化範圍,字串
setCellFont:滑鼠點選/懸浮時儲存格字體變化
setRowFont:滑鼠點選/懸浮時儲存格所在行字體變化
opts:變化屬性,json 格式
1)style: 字體格式,json 格式
bold: 是否粗體,true 粗體,false 正常
italic: 是否斜體,true 斜體,false 正常
fontFamily: 字體,字串
strikeThrough:是否有刪除線,true 有,false 無
fontSize: 字號,數字
subscript: 是否靠上顯示,true 是,false 否
underLine: 底線樣式,json 格式
width:線寬,新版決策報表中預設為 0 ,必須設定後才能顯示
style: 線型,字串,solid 實線 ,dashed 虛線
color: number 顏色,十六進制顏色程式碼
例如:underLine:{ width: 2, style: 'solid', color: '#000000' }
textShadow: 文字是否有陰影效果,true 是,false 否
supscript: 是否靠下顯示,true 是,false 否
color: number 字體顏色,十六進制顏色程式碼
2)trigger: 滑鼠的操作,不寫時預設為滑鼠懸浮
mouseover :滑鼠懸浮
mousedown:滑鼠點選
3)single:恢復邏輯,布林型,預設 true
true:
trigger為mouseover、single為true:滑鼠懸浮的位置變色,滑鼠懸浮到其他位置,顏色轉移到新位置
trigger為mousedown、single為true:滑鼠點選的位置變色,再次點選該位置顏色恢復/點選其他位置顏色轉移到新位置
false:滑鼠懸浮/點選的所有位置均會變色,再次懸浮/點選該位置顏色恢復
傳回值
void
行動端
APP\H5 版本 11.0.70 及以後支援該API。
設定【addEffect】第一個參數 【type】值為 【setCellFont】 ,滑鼠點選或者懸浮儲存格,儲存格字體格式變化。
範例1:若獲取到的報表塊物件定義為 【report】 ,滑鼠懸浮時字體顯示為紅色粗體 14 號,離開時恢復。
<!-- 滑鼠懸浮時字體顯示為紅色粗體 14 號,離開時恢復。 -->report.addEffect('setCellFont', { style: { bold: true, fontSize: 14, color: 'red' }, trigger: 'mouseover', single: true});
範例2:若獲取到的報表塊物件定義為 【report】 ,滑鼠點選儲存格時字體顯示為紅色粗體 14 號,再次點選時恢復。
<!-- 滑鼠點選儲存格時字體顯示為紅色粗體 14 號,再次點選時恢復。 -->report.addEffect('setCellFont', { style: { bold: true, fontSize: 14, color: 'red' }, trigger: 'mousedown', single: false});
範例3:普通報表中,滑鼠懸浮儲存格時字體顯示為紅色粗體 14 號,離開時恢復。
<!-- 滑鼠懸浮儲存格時字體顯示為紅色粗體 14 號,離開時恢復。 -->_g().addEffect('setCellFont', { style: { bold: true, fontSize: 14, color: 'red' }, trigger: 'mouseover', single: true});
範例4:普通報表中,滑鼠點選儲存格時字體顯示為紅色粗體 14 號,再次點選時恢復。
<!-- 滑鼠點選儲存格時字體顯示為紅色粗體 14 號,再次點選時恢復。 -->_g().addEffect('setCellFont', { style: { bold: true, fontSize: 14, color: 'red' }, trigger: 'mousedown', single: false});
範例5:決策報表中,滑鼠懸浮儲存格時字體顯示為紅色粗體 14 號,離開時恢復。
<!-- 滑鼠懸浮儲存格時字體顯示為紅色粗體 14 號,離開時恢復。 -->_g().getWidgetByName('report0').addEffect('setCellFont', { style: { bold: true, fontSize: 14, color: 'red' }, trigger: 'mouseover', single: true});
範例6:決策報表中,滑鼠點選儲存格時字體顯示為紅色粗體 14 號,再次點選時恢復。
<!-- 滑鼠點選儲存格時字體顯示為紅色粗體 14 號,再次點選時恢復。 -->_g().getWidgetByName('report0').addEffect('setCellFont', { style: { bold: true, fontSize: 14, color: 'red' }, trigger: 'mousedown', single: false});
範例1:滑鼠點選儲存格時字體顯示為紅色粗體 14 號,離開時恢復。點選可下載範本:滑鼠懸浮儲存格字體變化.cpt。
範例2:滑鼠點選儲存格時字體顯示為紅色粗體 14 號,再次點選時恢復。點選可下載範本:滑鼠點選儲存格字體變化.cpt。
設定【addEffect】 第一個參數 【type】值為 【setRowFont】,滑鼠點選或者懸浮儲存格,儲存格所在列字體格式變化。
範例1:若獲取到的報表塊物件定義為 【report】 ,滑鼠懸浮儲存格時,所在列字體顯示為紅色粗體 14 號,移動到其他列恢復。
<!-- 滑鼠懸浮儲存格時,所在列字體顯示為紅色粗體 14 號,移動到其他列恢復。 -->report.addEffect('setRowFont', { style: { bold: true, fontSize: 14, color: 'red' }, trigger: 'mouseover', single: true});
<!-- 滑鼠點選儲存格時字體顯示為紅色粗體 14 號,再次點選時恢復。 -->report.addEffect('setRowFont', { style: { bold: true, fontSize: 14, color: 'red' }, trigger: 'mousedown', single: false});
<!-- 滑鼠懸浮儲存格時字體顯示為紅色粗體 14 號,離開時恢復。 -->_g().addEffect('setRowFont', { style: { bold: true, fontSize: 14, color: 'red' }, trigger: 'mouseover', single: true});
<!-- 滑鼠點選儲存格時字體顯示為紅色粗體 14 號,再次點選時恢復。 -->_g().addEffect('setRowFont', { style: { bold: true, fontSize: 14, color: 'red' }, trigger: 'mousedown', single: false});
<!-- 滑鼠懸浮儲存格時字體顯示為紅色粗體 14 號,離開時恢復。 -->_g().getWidgetByName('report0').addEffect('setRowFont', { style: { bold: true, fontSize: 14, color: 'red' }, trigger: 'mouseover', single: true});
<!-- 滑鼠點選儲存格時字體顯示為紅色粗體 14 號,再次點選時恢復。 -->_g().getWidgetByName('report0').addEffect('setRowFont', { style: { bold: true, fontSize: 14, color: 'red' }, trigger: 'mousedown', single: false});
範例1:滑鼠懸浮儲存格時,所在列字體顯示為紅色粗體 14 號,移動到其他列恢復。點選可下載範本:滑鼠懸浮儲存格所在列字體變化.cpt。
範例2:滑鼠點選儲存格時,所在列字體顯示為紅色粗體 14 號,再次點選恢復。點選可下載範本:滑鼠點選儲存格所在列字體變化.cpt。
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
反馈已提交
网络繁忙