superRaytin / paginationjs

A jQuery plugin to provide simple yet fully customisable pagination.
http://pagination.js.org
MIT License
912 stars 659 forks source link

I can't find "isString()" where is the function defined in pagination.js ? #79

Closed zlongxiang closed 5 years ago

zlongxiang commented 6 years ago

when I look the pagination.js code in #69 has the 'isString( )' function, but I can't find where it defined. I look for this function because the parameter "totalNumberLocator" is not effective when I use dataSource's type is string. May you can help me! Thank you!

zlongxiang commented 6 years ago

I found. It defined the end of the file.

// Object type detection function getObjectType(object, tmp) { return ( (tmp = typeof(object)) == "object" ? object == null && "null" || Object.prototype.toString.call(object).slice(8, -1) : tmp ).toLowerCase(); }

$.each(['Object', 'Array', 'String'], function(index, name) { Helpers['is' + name] = function(object) { return getObjectType(object) === name.toLowerCase(); }; });

But in "findTotalNumberFromRemoteResponse( )" function self.model.totalNumber is not effective !

zlongxiang commented 6 years ago

I find the reason. I use $('.pagination_page').pagination({ }) to init, but in my html page has two .pagination_page class, so it cause error.