Skip to content
This repository has been archived by the owner on May 30, 2021. It is now read-only.

implement paging and scrollY #57

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

johanneswilm
Copy link

Hey,
there are still some things not entirely clear to me, and I don't know if this is how you would do it, but I tried to stick to your coding style as much as possible and did it in a similar way to how it's done in jQuery Datatables. I worked on the 1.6 rather than the 2.0 branch, give that it wasn't clear to me on which one you working.

Relates to #56 .

@johanneswilm
Copy link
Author

@Mobius1 One that that was not very clear to me was if it's always the case that this.activeHeadings is the same as this.table.tHead.firstElementChild.children when the table had a tHead. I assumed they are the same, and it works in the test there is, but maybe with other options it works differently? Anyway, have a look.

@johanneswilm
Copy link
Author

@Mobius1 With these changes applied, it now seems to work in all our views. However, we always only have one table per page, so we don't notice the kind of leakage reported in #58 .

@johanneswilm
Copy link
Author

@Mobius1 How do you want me to continue to work on this?

johanneswilm and others added 5 commits April 28, 2018 22:35
After few hours to solve mystery "doublons" and
sort don't work in my old Chomium browser ( chromium.31)

Test with other version Same result (2.0.0.a23, 1.6.10,) and ...
In v1.2.2 nothing TDs duplicated on init but atfer sorting yes ;)

Forward to Present ... And
After more tests & logs for find where TD is duplicated

In dataTable vanilla Columns.prototype.rebuild
Before // Loop over the rows and reorder the cells
 dt.data are ok
but after each() : a & b clones TD is duplicated!

Only cloneNode(false) remove dublicated TDs
chrome: default param deep is false (maybe not)
Tested with true (TDs duplicated)
https://developer.mozilla.org/fr/docs/Web/API/Node/cloneNode

Rest of update code seems more speedy, with src file :)

##Info

Solve my problems callback modify td content in event : sort
 dataTable.on('datatable.'+events
i use events init, refresh & sort

just an impression or lost important data?

cell -> c is maybe more logic for chain object?
It's just an intiuition, but if possible not (used in a test).
work fine with no doublons with original code
```
                if (dt.hiddenColumns.indexOf(cell.cellIndex) < 0) {
                    d = cell.cloneNode(true);
                    d.data = cell.data;
```

Why td create an element tr & then unused before each()?
probably oups :)
work fine with no doublons with original code
```
var td, tr = createElement("tr");
```

In One moment Chromium say : data is undefined
in Columns.prototype.sort
 var content ...  cell.data is undefined : Chromium 31
 && test with cell.innertext is undefined in Firefox 43

I have used this to solve the trouble
```
var content = cell.hasAttribute('data-content') ? cell.getAttribute
('data-content') : cell.data;
```
replaced by
```
var content = cell.hasAttribute('data-content') ?  cell.getAttribute
('data-content') : cell.data || cell.textContent ||
cell.innerText;//CrossBrowser Fix
```
[MDN textContent](https://developer.mozilla.org/en-
US/docs/Web/API/Node/textContent)

But,
with this update, now, all work fine in all levels, but why? :D

Tested ok with QUnit:
 Firefox 43 & 59
  Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0
  Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0
 Chromium 31 ;)
  Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/31.0.1650.63 Safari/537.36
in firefox, if the csv data has a "#" in it, the file ends at the index of the first occurrence. additionally, encodeURI doesn't encode "#" since it's a valid uri character.
@johanneswilm
Copy link
Author

@Mobius1 Ping! Are you still working on this or would it be better to simply fork and create a new package? I see there are now 5 PRs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants