如何使用angular8切换行

时间:2020-03-18 09:39:35

标签: javascript angular

我有多行,如果我打开一行,那么我将无法切换它,这意味着除非单击另一行以查看内部数据,否则它将不会关闭。 如果我没有对表单进行任何更改,我必须能够切换行,以防万一我对表单进行了更改,它必须向我显示一条确认消息,如当前显示的那样。

演示: DEMO

TS:

 editEo(eo,index) {

      if(this.eoInfoForm.dirty) {

        this.confirmationDialogService.confirm('Please confirm..', 'Do you really want to save changes ?')
    .then((confirmed) => {
         let openedIndex = this.eoList.findIndex(obj => obj.OpenCloseStatus === true);
        confirmed ? this.OpenCloseEvent(eo,openedIndex):this.OpenCloseEvent(eo,index);
      if(confirmed){
        console.log("works")
      }
    })
    .catch(() => console.log('User dismissed the dialog (e.g., by using ESC, clicking the cross icon, or clicking outside the dialog)'));

  }else {
          //  this.eoDetailsList = previous; 
           eo.isCollapse = !eo.isCollapse
           this.OpenCloseEvent(eo,index);
          }
  }

HTML:

 <a href="javascript:void(0);" (click)="editEo(eo,i)" class="accordion-toggle">+ </a>

1 个答案:

答案 0 :(得分:2)

只需替换行:

Module Module1

    Dim pnum As String
    Dim top As Integer
    Dim arraystack(top) As Char
    Sub putinstack(ByVal n As String)
        Dim i, lenght As Integer

        top = 0
        lenght = Len(n)
        For i = 1 To lenght
            top = top + 1
            arraystack(i) = Mid(pnum, i, 1)


        Next

    End Sub


    Function palindromic(p As String) As Boolean

        Dim yon As Boolean
        yon = True
        Dim cnt As Integer
        cnt = 0
        While top >= cnt

            cnt = cnt + 1
            While arraystack(top) <> arraystack(cnt)
                yon = False
            End While
            top = top - 1


        End While
        Return yon

    End Function




    Sub Main()

        Console.WriteLine("insert number you wish to know is palindromic or not!")
        pnum = Console.ReadLine.ToString

        Call putinstack(pnum)

        If palindromic(pnum) = True Then

            Console.WriteLine("num is palindromic")
        Else
            Console.WriteLine("num is not palindromic")

        End If

        Console.ReadKey()



    End Sub

End Module

具有:

this.eoList[objIndex]['OpenCloseStatus'] = true;