ForgeComponents
en

Components

j-Listing

jComponent 20 · jcomponent@20 component Example loaded with jComponent 20
  • works with the whole Arrays only on client-side

Configuration:

  • count {Number} Optional, items per page (default: 20)
  • pages {Number} Optional, max pages in pagination (default: 3 --> half + current page + half)
  • scrolltop {Boolean} scrolls top automatically when the user changes a page
  • parent {String} jQuery selector for obtaining of height, enables fixed area with custom scrollbars
  • margin {Number} a margin for parent (default: 0)
  • marginxs {Number} optional, a top/bottom margin together for xs screen width
  • marginsm {Number} optional, a top/bottom margin together for sm screen width
  • marginmd {Number} optional, a top/bottom margin together for md screen width
  • marginlg {Number} optional, a top/bottom margin together for lg screen width
  • pluralizeitems {String} a pluralization for count of all items, form: # zero,# one,# two-four,# five and more
  • pluralizepages {String} a pluralization for count of all items, form: # zero,# one,# two-four,# five and more
  • NEW: scrollbarshadow {Boolean} enables scrollbar shadow

Tangular layout:

  • body {String} contains all rendered items, output is HTML
  • page {Number} current page number
  • pages {Number} count of pages
  • count {Number} count of items

Tangular item:

  • model contains an object from Array
  • second model contains info about data-source { index: Number, page: Number, pages: Number, count: Number }

Use it with <ui-component name="listing">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

example.html
<div class="row">
	<div class="col-sm-6">
		<h2>With layout</h2>
		<ui-component name="listing" path="items">
			<script type="text/html">
				<div class="col-xs-4">
					<div>Item: {{ name }}</div>
				</div>
			</script>
			<script type="text/html">
				<div><b>Layout:</b></div>
				<br />
				<div class="row">{{ body | raw }}</div>
			</script>
		</ui-component>
		<br />
	</div>

	<div class="col-sm-6">
		<h2>Without layout</h2>
		<ui-component name="listing" path="items" config="count:8">
			<script type="text/html">
				<div>
					<div>Item: {{ name }}</div>
				</div>
			</script>
		</ui-component>
		<br />
	</div>
</div>

<script>

	var items = [];
	for (var i = 0; i < 100; i++)
		items.push({ name: GUID(10) });

</script>