Closed monocraft closed 9 years ago
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);
Do you have any example with callbackSuccess? I implemented that change but how would I access the data.length from front end?
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);
You'd do it like this:
$('#map-container').storeLocator({
'callbackSuccess' : function ( dataLength ) {
$('#something').text( dataLength );
}
});
Thank you Bjorn. Very clean.
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);
}
Hi Bjorn, Is there a way to get the count of the found location after search? Thank you for sharing this.