Giter VIP home page Giter VIP logo

Comments (6)

bjorn2404 avatar bjorn2404 commented on July 24, 2024 1

You'd do it like this:

$('#map-container').storeLocator({
    'callbackSuccess' : function ( dataLength ) {
         $('#something').text( dataLength );
    }
});

from jquery-store-locator-plugin.

bjorn2404 avatar bjorn2404 commented on July 24, 2024

Hello,

Currently there is not but you could modify the callbackSuccess to do it. If you're using XML you can update on 1561:

_this.settings.callbackSuccess.call(this);

to:

_this.settings.callbackSuccess.call(this, $(data).find(_this.settings.xmlElement).length);

With JSON:

_this.settings.callbackSuccess.call(this, data.length);

from jquery-store-locator-plugin.

monocraft avatar monocraft commented on July 24, 2024

Do you have any example with callbackSuccess? I implemented that change but how would I access the data.length from front end?

from jquery-store-locator-plugin.

monocraft avatar monocraft commented on July 24, 2024

I couldn't figure out how you use callback so I just edit the source directly to give me the show store vs the total.

#line 1980
$('#write span').text(storeNumToShow + " Out of "+ data.length);

from jquery-store-locator-plugin.

monocraft avatar monocraft commented on July 24, 2024

Thank you Bjorn. Very clean.

from jquery-store-locator-plugin.

monocraft avatar monocraft commented on July 24, 2024

I wanted the current number on the list also so I created another callback.

#line 88
'callbackStoreNum'         : null,
#line 1800
            // Callback callbackStoreNum
            if (_this.settings.callbackStoreNum) {
                _this.settings.callbackStoreNum.call(this, storeNumToShow, data.length);
            }

from jquery-store-locator-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.