如何解决在JS的DataTable中破坏table.rowsiterator
我想中断DataTable()的交互。 这是我的代码
Yes i have an exemple : {"pagination":
{"limit":25,"offset":0,"count":25,"total":13339023},"data":
[{"author":"Reuters","title":"Guinea\u2019s Conde wins presidency with 59.5%
of vote -election commission","description":"CONAKRY \u0026#8212; President
Alpha Conde of Guinea won the Oct. 18 election with 59.5% of the vote,according to a full preliminary tally from the election commission on
Saturday. The victory,which requires confirmation by the Constitutional
Court,gives a third term in office to the 82-year-old Conde after a bitterly
fought election in which[\u0026#8230;]","url":"https:\/\/nationalpost.com\/pmn\/news-pmn\/guineas-conde-wins-presidency-with-59-5-of-vote-election-commission","source":"nationalpost","image":null,"category":"general","language":"en","country":"us","published_at":"2020-10-24T13:53:58+00:00"}
解决方法
使用Sub OneFindingPerId()
'[0]get data
Dim data: data = Sheet1.Range("A1:D10") ' << project's sheet Code(Name)
Dim b: b = Application.Index(data,2) ' 2nd column (B)
Dim c: c = Application.Index(data,3) ' 3rd column (C)
'[1]get position indices of identic strings via Match() function
Dim chk: chk = Application.Match(b,c,0) ' found row nums of a items in b
'[2]loop found position indices (i.e. no error 2042)
Dim i As Long
For i = 2 To UBound(chk) ' omit header row
'a) define start index of new id and initialize result with 0
If data(i,1) <> data(i - 1,1) Then
Dim newId As Long: newId = i
data(newId,4) = 0
End If
'b) check if found row index corresponds to same id
If Not IsError(chk(i,1)) Then ' omit error 2042 values
If data(chk(i,1),1) = data(i,1) Then ' same ids?
If data(newId,4) = 0 Then data(newId,4) = 1 ' ~> result One if first occurrence
End If
End If
Next i
'[3]write results
Sheet1.Range("A1").Resize(UBound(data),UBound(data,2)) = data
End Sub
代替nodes()
iterator()
或带有table.rows().nodes().to$().find('input:not(:checked):first').length // 0 - all checked
each()
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。