Lift/Comet table widget

34 views
Skip to first unread message

Donald McLean

unread,
Mar 6, 2018, 10:01:34 AM3/6/18
to liftweb
I've been using Lift now for going on 7 years (!!) and up to this
point I've been doing my client side tables using DataTables with
Comet updates.

While DataTables works great for two of my three cases, the third case
is becoming increasingly problematic and I need to find (or write) a
better solution.

The three cases are:

1. Small amount of data, updating in "real time" (it's actually polling)

2. Data is coming from a database, user driven updating

3. Large amounts of data (I saw 150,000 records once), updating in "real time"

In all three cases, the users expect moderately responsive
sorting/filtering. Cases two and three also have to using paging.

So I'm asking the community for recommendations as to what my options are here.

I would prefer to adapt an existing library, but if necessary, I am
willing to write something to meet my needs, and I'm willing to work
with others to create a more generic library solution.

Thanks,

Donald

Diego Medina

unread,
Mar 6, 2018, 10:45:05 AM3/6/18
to Lift
For case 3, do you load all 150k rows into the client? I used to do the same (I think I used to limit it to 20k though), but eventually went with only loading the number of rows you see on one page, and request more rows from the server using things like ajaxCall and family when applying a filter/sorting.

As a user, I much rather deal with a bit of lag when filtering, because of the network latency, than having my browser tab use 2G+ of memory. And from the dev side, if getting 20 rows is slow, I need to just a way to optimize the db, limit the json data I send so that rendering isn't slow.

Regards,

Diego




--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Donald McLean

unread,
Mar 6, 2018, 11:10:18 AM3/6/18
to liftweb
No, I most emphatically do not want 150k rows on the client.

The issue is that, because the data is updating in "real time", some
(or even all) of the entries on any given page could be removed by the
source.

I would rather have an integrated library that handles stuff "under
the hood" rather than have to write a bunch of custom, piecemeal
components.
>> email to liftweb+u...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> Diego Medina
> Go Consultant
> di...@fmpwizard.com
> https://blog.fmpwizard.com/
>
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to liftweb+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Family photographs are a critical legacy for
ourselves and our descendants. Protect that
legacy with a digital backup and recovery plan.

Antonio Salazar Cardozo

unread,
Mar 6, 2018, 12:51:09 PM3/6/18
to Lift
Are you trying to create one thing for all three, or are you interested in solutions
for each?
Antonio

Donald McLean

unread,
Mar 6, 2018, 4:35:22 PM3/6/18
to liftweb
Unfortunately, I don't always know know when I'm going to have a small
amount of data, and when I'm going to have a large amount of data. So
I need two solutions, one for case two, and one for case three - the
third case being the one that I don't currently have a solution for.
Case one I will just handle as case three, then if the volume becomes
unexpectedly large, I'm covered.

Antonio Salazar Cardozo

unread,
Mar 6, 2018, 11:15:18 PM3/6/18
to Lift
Cool, so just to check we're looking for a table that sorts, filters, and pages, and has to display
up to N items. Are these items updating constantly, or do they only update on user action like
a filter/page/sort/refresh action?
Thanks,
Antonio

Donald McLean

unread,
Mar 7, 2018, 9:25:01 AM3/7/18
to liftweb
That's two different cases, and I have both.

I have some tables where the data is constantly updating. Those are
the ones that I need a new solution for.

On Tue, Mar 6, 2018 at 11:15 PM, Antonio Salazar Cardozo
>> > email to liftweb+u...@googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Family photographs are a critical legacy for
>> ourselves and our descendants. Protect that
>> legacy with a digital backup and recovery plan.
>
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to liftweb+u...@googlegroups.com.

Antonio Salazar Cardozo

unread,
Mar 7, 2018, 12:59:21 PM3/7/18
to Lift
5s outline thought: track filter, sort, etc parameters in a comet. As new data comes in,
compare it to those parameters and see if the list of “current items” will change. If so,
recompute them and rerender the comet (or send down a partialUpdate with new JSON,
if that's how you're operating).
Thanks,
Antonio
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Family photographs are a critical legacy for
>> ourselves and our descendants. Protect that
>> legacy with a digital backup and recovery plan.
>
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To unsubscribe from this group and stop receiving emails from it, send an

Donald McLean

unread,
Apr 5, 2018, 9:12:38 AM4/5/18
to liftweb
There are two types of "data sources"

1. Active data sources (for lack of a better term) that are in memory,
directly control their data, know when something has been updated, and
can post add/update/delete messages to an actor.

2. Passive data sources (for lack of a better term) (such as a remote
DB) that are not in memory, do not control their data and so have no
specific knowledge of updates and thus can't post update messages to
an actor.

Also, is there a JavaScript table library that would be good for the
client side part - something that could easily be updated? Not
DataTables, which has only two modes - the client gets all the data
and does everything - or - the server does everything, but only when
requested by the client.

On Wed, Mar 7, 2018 at 12:59 PM, Antonio Salazar Cardozo
>> >> > email to liftweb+u...@googlegroups.com.
>> >> > For more options, visit https://groups.google.com/d/optout.
>> >>
>> >>
>> >>
>> >> --
>> >> Family photographs are a critical legacy for
>> >> ourselves and our descendants. Protect that
>> >> legacy with a digital backup and recovery plan.
>> >
>> > --
>> > --
>> > Lift, the simply functional web framework: http://liftweb.net
>> > Code: http://github.com/lift
>> > Discussion: http://groups.google.com/group/liftweb
>> > Stuck? Help us help you:
>> > https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>> >
>> > ---
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Lift" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to liftweb+u...@googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Family photographs are a critical legacy for
>> ourselves and our descendants. Protect that
>> legacy with a digital backup and recovery plan.
>
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to liftweb+u...@googlegroups.com.

Dan Gravell

unread,
Apr 6, 2018, 3:46:13 AM4/6/18
to Lift
I found SlickGrid much better for larger, changing, datasets. AIUI the author ran out of time to maintain it and has now been forked, so maybe look into that.

Dan
Reply all
Reply to author
Forward
0 new messages