raulrene / plain-js-pagination Goto Github PK
View Code? Open in Web Editor NEWPlain Javascript pagination plugin
Plain Javascript pagination plugin
Hello,
this pagination is great, but I have a problem about the array.
var all = [
{"id": 1, "text": "Element 1", "sub": [
{"id": "1.1", "content": "Element 1.1"}
]},
{"id": 2, "text": "Element 2"},
{"id": 3, "text": "Element 3"},
{"id": 4, "text": "Element 4"},
{"id": 5, "text": "Element 5"},
{"id": 6, "text": "Element 6"},
{"id": 7, "text": "Element 7"},
{"id": 8, "text": "Element 8"},
{"id": 9, "text": "Element 9"},
{"id": 10, "text": "Element 10"},
{"id": 11, "text": "Element 11"},
{"id": 12, "text": "Element 12"},
{"id": 13, "text": "Element 13"},
{"id": 14, "text": "Element 14"},
{"id": 15, "text": "Element 15"}
];
...
function myListFunction(startFrom, numberOfElements) {
...
// Construct the List HTML
console.log("Main: " + response.list.length);
for (var i = 0; i < response.list.length; i++) {
listHtml += '<div>' + response.list[i].text + '</div>';
console.log("Sub: " + response.list[i].sub.length);
for (var j = 0; j < response.list[i].sub.length; j++) {
listHtml += '<div>' + response.list[i].sub[j].content + '</div>';
}
}
...
}
The second (each additional lower loop) loop is not working and I have also check with map function, but the same problem.
Can you help me please?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.