Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

backbone.marionette-lazy-loading-module

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backbone.marionette-lazy-loading-module

Lazy loading data module for backbone.marionette

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

#Backbone.marionette lazy loading module

Lazy loading data module for backbone.marionette

##Getting started

###Quick start

  • Clone the repository: git clone https://github.com/denar90/backbone.marionette-lazyLoading-module.git
  • Add dependency into your bower.json file and run bower install

##Usage

  • Configure your requirejs file
	require.config({
    	...
    	paths: {
    		...
    		app: 'path-to-app-file',
    		lazyLoading: 'path-to-module' // example 'modules/backbone.marionette-lazyLoading-module/'
    		...
    	}
    	...
    });
  • Include and run module
	//for example
	define(['marionette', 'lazyLoading/lazyLoading'], function(Marionette, lazyLoading) {
    	var App = new Marionette.Application();

    	App.addRegions({
    		mainRegion: '#app'
    	});

    	App.on("start", function() {
    		if (Backbone.history) {
    			Backbone.history.start();
    			lazyLoading.start({
    				moduleRegion: App.mainRegion,
    				getDataUrl: 'getData.php',
    				offset: 0,
    				limit: 10
    			});
    		}
    	});

    	return App;
    });

##Options

moduleRegion
  • type: Object

Required param.

Region where data will be past

getDataUrl
  • type: String
  • default: ''

Url to getting data from server. Module automatically will be build url with offset and limit.

offset
  • type: String
  • default: 0

Data offset. Says server from what number get data

limit
  • type: String
  • default: 10

Data limit for one request.

listTemplate
  • type: string
  • default: ''

Template for all list of data. It's kind of container. If listTemplate isn't set module will use default.

itemTemplate
  • type: string
  • default: ''

Template for each item. If itemTemplate isn't set module will use default.

Keywords

FAQs

Package last updated on 18 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc