Comments (4)
Sorry for the brief response, I'm traveling.
Sheetrock is designed to have a 1:1 correspondence between DOM elements and queries. This aids with lazy-loading. So when you try to attach a different query, Sheetrock thinks it has already loaded the data.
However, it's relatively easy to "unload" or detach the previous query. You should be able to do something like this:
$('#playerdata').empty().data('sheetrockLoaded', false).sheetrock({...});
I can't test that at the moment, so apologies if the chaining isn't quite right.
In the future, perhaps I could test to see if the query has changed and do this automatically.
from sheetrock.
Hi Chris,
I've been traveling too, but I had time to try out the method you suggested and it worked. Thanks! I had tried empty(), but that didn't quite do it. I didn't think to chain that all together like your example.
And again, thanks for sheetrock. I'm finding it very useful.
Zach
from sheetrock.
FYI: I've addressed this in version 0.1.7 (just released). I've abandoned the previous 1:1 correspondence between DOM elements and queries, which wasn't really necessary and led to understandable confusion.
I also changed the way Sheetrock stores "flags" or "indicators"βfor row offset, errors, and query completion. Previously it used jQuery.data
which solidified the aforementioned 1:1 correspondence. Now it keeps track of them internally, indexed by unique query.
The fix we discussed above will continue to work, but the data(...)
method is now unnecessary. With the latest version, you can simplify to:
$('#playerdata').empty().sheetrock({...});
Additionally, there's a new option (resetStatus
) that allows you to reset the flags/indicators. This is useful if, for example, you'd like to load the exact same query again, reset the row offset, or try again after an error.
from sheetrock.
I had this problem too. Just for other people to know, now we have the option attribute "resetStatus": https://github.com/chriszarate/sheetrock#resetstatus.
I just set it to true and it worked. Thanks, great plugin.. Congrats! π
from sheetrock.
Related Issues (20)
- Few header title aren't display HOT 1
- Example using Node.js HOT 1
- Sheetrock possibly returning nothing to Handlebars function
- how to pass the output to a chart?
- Header row showing in results HOT 3
- Adding handlebars context?
- SheetrockError: Request failed.
- using index.js and formatting cell entries
- Trouble sorting with double named cells
- Column order changes when first row contains only numbers
- Fetch Size sometimes fetches 1 more row than requested
- Using datatables with sheetrock yields Uncaught TypeError HOT 3
- No longer working HOT 3
- Uncaught TypeError: object is not iterable (cannot read property Symbol(Symbol.iterator)) HOT 1
- Move through records
- The data table do not display with search & sorting filters HOT 5
- Is it possible to modify the google sheet if it has pubilc write access?
- Unknown TypeError: t is null
- Images on Google Sheet -> Sheetrock -> HTML
- Transport-browser.js - "PENDING"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sheetrock.