EloquentStudio / StreamTable.js

StreamTable.js streams data for tables in the background, updates and renders them using templating frameworks like Mustache.js, HandleBars.js
http://eloquentstudio.github.io/StreamTable.js/stream.html
MIT License
386 stars 77 forks source link

Manually add items #3

Closed MaxMelcher closed 10 years ago

MaxMelcher commented 10 years ago

Hi,

cool solution - I love the examples.

One Question: Is it possible to add new rows manually? I use SignalR to stream messages to my clients and I would love to add them to a datatable.

Is it supported?

Thanks! Max

jiren commented 10 years ago

Using "addData(data)" method you can add data manually.

var st = StreamTable('#stream_table', options, data);
st.addData(your new records) 
MaxMelcher commented 10 years ago

Jiren, thanks again! It works now!

I had to do one final thing to get IE to work because it thought that I do not pass an array: textFunc=function(t){return $.makeArray(t).join(" ").toUpperCase()}

the $.makeArray is a jquery function. Maybe I did something wrong because I add the lines one by one - try to pass a new Array() with 1 pushed element to addData but same result.