在此代码的结尾(第64行),有一个initCallback函数不起作用。它应该将数据从Google工作表中调用到我的网站(https://rentmyshit.emerson.build),但我看不到它。当我在搜索栏中搜索“ sony”或“ amp”时,它会为我提供一个数字结果,因此似乎在那儿但不可见。
Google表格
// Listify module
var Listify = {};
(function($) {
/**
Create a Listify listing
var listify = Listify.App({
// element to attach to (or jquery selector for that element)
el: #my-element
url: google spreadsheet url
// optional
template: mustache template to use for rendering
});
*/
Listify.App = function(options, initCallback) {
var my = {
options: options,
dataStore: null,
queryResults: [],
$el: $(options.el)
};
if (!my.options.template) {
my.options.template = ' \
<div class="booky"> \
{{#records}} \
<div class="record"> \
<div class="cover" style="background: url(\'{{imageurl}}\') no-repeat center;"></div> \
<div class="rhs"> \
<h2><a href="{{url}}" target="_blank">{{title}}</a></h2> \
<h3> \
{{#author}} \
<a href="{{authorurl}}" target="_blank">by {{author}}</a> \
{{/author}} \
\
</h3> \
<p class="type">{{type}}</p> \
<p class="description" title="{{description}}">{{description}}</p> \
</div> \
</div> \
{{/records}} \
</div> \
'
}
my.initialize = function() {
my.$el.html(my.templateOuter);
// bind search actions etc
my.$el.find('.query input').keyup(function(e) {
my.query()
});
// load the data
recline.Backend.GDocs.fetch({url: my.options.url}).done(function(data) {
my.$el.find('.loading').hide();
my.metadata = data.metadata;
my.metadata.url = my.options.url;
my.dataStore = new recline.Backend.Memory.Store(data.records, data.fields);
my.queryResults = my.dataStore.data;
my.render();
initCallback(null);
$(document).trigger('listify:data:loaded');
});
};