javve / list.pagination.js

A pagination plugin for List.js
24 stars 23 forks source link

List is not defined with RequireJS #4

Open tnguyen14 opened 10 years ago

tnguyen14 commented 10 years ago

I am trying to use this plugin with RequireJS.

In my config, I already declared listjs as a dependency for this plugin.

However, when I use the plugin, I get this error Uncaught ReferenceError: List is not defined on line 521.

Can you help?

Pwntastic commented 10 years ago

I'm also unable to get this working properly with RequireJS. I've tried a few shims and things, but nothing seems to work.

taichi-master commented 10 years ago

I don't know if this is the standard solution, but it seems like the List has to be made global.

So what I did is to assign the "LIST" to List in domReady function. i.e. in main.js: require(['domReady', 'list'], function(domReady, LIST) { domReady( function() { // global List = LIST;

Of course no need to specify the "List" in your module any more. in your module: define(['list.pagination'], function(ListPagination) { var monkeyList = new List('test-list', { valueNames: ['name'], page: 3, plugins: [ ListPagination({}) ] });

by the way, no need to add any shim in main.js to make this to work.

javve commented 9 years ago

This will be fixed in the next version! Nice that you found the bug :+1:

ReservedDeveloper commented 9 years ago

Any update on this? There haven't been any commits since last year. Should we consider this project abandoned?

Saturate commented 8 years ago

@ReservedDeveloper I guess, nearly one year later and nothing has happend to fix it.

ghost commented 8 years ago

+1

ghost commented 8 years ago

@javve you have a expectation to fix it ?

localdrive commented 8 years ago

+1

jonatasfreitasv commented 8 years ago

+1

apijay commented 8 years ago

+1

antoine3000 commented 7 years ago

Hi, Is this fixed ? I still have the error Uncaught ReferenceError: List is not defined.