list.pagination.js icon indicating copy to clipboard operation
list.pagination.js copied to clipboard

List is not defined with RequireJS

Open tnguyen14 opened this issue 11 years ago • 11 comments

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?

tnguyen14 avatar Feb 16 '14 00:02 tnguyen14

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

Pwntastic avatar Apr 21 '14 23:04 Pwntastic

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.

taichi-master avatar Jul 08 '14 16:07 taichi-master

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

javve avatar Aug 30 '14 18:08 javve

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

ReservedDeveloper avatar Mar 23 '15 19:03 ReservedDeveloper

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

Saturate avatar Aug 05 '15 09:08 Saturate

+1

ghost avatar Aug 14 '15 18:08 ghost

@javve you have a expectation to fix it ?

ghost avatar Aug 14 '15 18:08 ghost

+1

localdrive avatar Aug 24 '15 21:08 localdrive

+1

jonatasfreitasv avatar Aug 24 '15 21:08 jonatasfreitasv

+1

apijay avatar Oct 27 '15 20:10 apijay

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

antoine3000 avatar Jun 28 '17 14:06 antoine3000