File tree Expand file tree Collapse file tree
Typescript/pivot-table/src/app Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ function updateReport(reportList) {
159159 reportListObj [ 0 ] . dataSource = reportList ;
160160 reportListObj [ 0 ] . value = pivotTableObj . toolbarModule . currentReport ;
161161 // For remove report
162- if ( pivotTableObj . toolbarModule . currentReport === "" && reportListObj [ 0 ] . itemData === null ) {
162+ if ( pivotTableObj . toolbarModule . currentReport === "" && ( reportListObj [ 0 ] . itemData === null || reportList . length < 2 ) ) {
163163 pivotTableObj . toolbarModule . currentReport = reportList [ reportList . length - 1 ] ;
164164 reportListObj [ 0 ] . value = pivotTableObj . toolbarModule . currentReport ;
165165 pivotTableObj . loadReport ( { reportName : reportList [ reportList . length - 1 ] } ) ;
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export default class App extends Component {
2727 reportListObj [ 0 ] . dataSource = reportList ;
2828 reportListObj [ 0 ] . value = this . pivotObj . toolbarModule . currentReport ;
2929 // For remove report
30- if ( this . pivotObj . toolbarModule . currentReport === "" && reportListObj [ 0 ] . itemData === null ) {
30+ if ( this . pivotObj . toolbarModule . currentReport === "" && ( reportListObj [ 0 ] . itemData === null || reportList . length < 2 ) ) {
3131 this . pivotObj . toolbarModule . currentReport = reportList [ reportList . length - 1 ] ;
3232 reportListObj [ 0 ] . value = this . pivotObj . toolbarModule . currentReport ;
3333 this . loadReport ( { reportName : reportList [ reportList . length - 1 ] } )
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ function updateReport(reportList: any) {
117117 reportListObj [ 0 ] . dataSource = reportList ;
118118 reportListObj [ 0 ] . value = ( pivotTableObj . toolbarModule as any ) . currentReport ;
119119 // For remove report
120- if ( ( pivotTableObj . toolbarModule as any ) . currentReport === "" && reportListObj [ 0 ] . itemData === null ) {
120+ if ( ( pivotTableObj . toolbarModule as any ) . currentReport === "" && ( reportListObj [ 0 ] . itemData === null || reportList . length < 2 ) ) {
121121 ( pivotTableObj . toolbarModule as any ) . currentReport = reportList [ reportList . length - 1 ] ;
122122 reportListObj [ 0 ] . value = ( pivotTableObj . toolbarModule as any ) . currentReport ;
123123 pivotTableObj . loadReport ( { reportName : reportList [ reportList . length - 1 ] } ) ;
You can’t perform that action at this time.
0 commit comments