Comments (3)
Okay, I finally found an answer. I've recreated the DOM structure of the List Widget in the coffeescript file using JQuery.
from dashing.
can you share your code?
from dashing.
Yes, of course :
My list.coffee file (when I receive some data, I use JQuery to recreate the DOM and avoid the blinking):
class Dashing.List extends Dashing.Widget
ready: ->
if @get('unordered')
$(@node).find('ol').remove()
else
$(@node).find('ul').remove()
onData: (data) ->
console.log($(@node).find('ul.list-nostyle').find('li'))
$(@node).find('ul.list-nostyle').find('li').remove()
for elt in data.items
s = '<li>
<div data-bind-class="item.color" class="' + elt.color + '">
<span class="label" data-bind="item.label">' + elt.label + '</span>
<span class="value" data-bind="item.value">' + elt.value + '</span>
</div>
</li>'
$(s).appendTo($(@node).find('ul.list-nostyle'));
My list.html file :
<h1 class="title" data-bind="title"></h1>
<ol>
<li data-foreach-item="items">
<div data-bind-class="item.color">
<span class="label" data-bind="item.label"> </span>
<span class="value" data-bind="item.value"> </span>
</div>
</li>
</ol>
<ul class="list-nostyle">
<li data-foreach-item="items">
<div data-bind-class="item.color">
<span class="label" data-bind="item.label"></span>
<span class="value" data-bind="item.value"></span>
</div>
</li>
</ul>
<p class="more-info" data-bind="moreinfo"></p>
<p class="updated-at" data-bind="updatedAtMessage"></p>
from dashing.
Related Issues (20)
- Eclipse IDE
- Scheduler, :handle_exception
- How to inject variables in the html of widgets HOT 1
- You have to install development tools first
- Installation on windows throws auth token error HOT 1
- Dashing Dashobarding
- How to leave blank space between widgets HOT 1
- Dynamically getting values based on data-id HOT 2
- Remove the 'Le' words from the wiki
- Issue Installing on Raspberry Pi HOT 1
- Add widget dynamically based on Server Result
- Save automatically gridster layout after drag widgets
- run job on page refresh
- Upgrade gemspec to run with Rack 1.6 aka Rails 4.2.10 HOT 1
- Suspected plagiarism HOT 1
- Margins around Dashboard
- Push successful but getting "Something Went Wrong"
- Smashing dashboard is displaying random value of "Last updated at"
- Dynamically change widgets data-id does nothing
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 dashing.