Git Product home page Git Product logo

plain-js-pagination's People

Contributors

raulrene avatar

Watchers

 avatar  avatar

plain-js-pagination's Issues

Array object nested array object - Not possible!

Hello,

this pagination is great, but I have a problem about the array.

My Code:

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.