This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-06-11
Channels
- # admin-announcements (96)
- # beginners (102)
- # boot (51)
- # clojure (234)
- # clojure-art (1)
- # clojure-berlin (6)
- # clojure-brasil (1)
- # clojure-china (1)
- # clojure-germany (24)
- # clojure-italy (25)
- # clojure-japan (22)
- # clojure-russia (85)
- # clojure-sg (3)
- # clojure-spain (6)
- # clojure-uk (7)
- # clojure-ukraine (3)
- # clojurescript (108)
- # code-reviews (11)
- # core-typed (3)
- # datomic (6)
- # docs (13)
- # editors (121)
- # euroclojure (10)
- # events (2)
- # jobs (7)
- # ldnclj (77)
- # off-topic (27)
- # reading-clojure (8)
- # reagent (27)
- # robots (2)
- # slack-help (22)
@jeff.terrell: well that's mostly Closure, I just make sure the code we generate doesn't get in the way
@ericnormand: clojurewest 2013 (where i met you) was 27 hours 😉
@jonpither: It does not exist(
@jonpither: you need to change the number of items to display on a single page?
@jonpither: may be http://facebook.github.io/fixed-data-table/ will fit your needs, tail-loading could be easily implemented for it instead of pagination
I guess it shouldn't be hard to build. Just have the meta table about the table in application state (no of pages, total number etc), what page you're on
@jonpither: Hi am about to share an Om table component that I use in my projects. It has sort and pagination included
@hmadelaine: very timely!
I think such a component would require support in the REST API it was talking to
i.e. via query parameters, or even resource ranges
@jonpither: Ok, I will try to share it this afternoon. You can build it in a couple of hours.
@ul: that is very cool. I didn't realise you can mix in react components so easily: https://github.com/ul/fixed-data-table-demo/blob/master/src/fixed_data_table_demo/core.cljs
@malcolmsparks: agreed. Similar components in other languages take this pagination params in request approach.
I want to build in pagination support into yada at some point, this stuff should be easier than it is right now, and it's the sort of thing you should be able to do decoratively rather than imperatively.
s/decoratively/declaratively
spell checker fail, yet 'decoratively' could be a thing too
@malcolmsparks: I’d be interested in seeing that. I haven’t had any time to look at yada yet. Day job gets in the way!
yada is still coming (like winter in #got), it's still alpha but a few brave people are trying it and giving useful feedback, but since this is a clojurescript channel i'll shut up now
@malcolmsparks: Nice thing about slack is you can edit your old messages 😜
@ul: I notice in your fixed-data-table the width is set to 100, Ideally it'd be great to specify the width as 100%, but I can't get this to work
you need to wrap like https://github.com/vaiRk/responsive-fixed-data-table
What's really annoying is how does one view the source code for these examples? https://facebook.github.io/fixed-data-table/example-flexgrow.html
@ul do you know where source code to the facebook examples are, i.e. how do they configure the tables to exhibit properties sort as sorting
do you need the debounce stuff? Or is it enough to plug in file-responsive-fixed-data-table-js?
@dmich: thanks for that tip. If I edit that message, should you delete your advice?
@malcolmsparks: transient message dependencies?
@jonpither: https://gist.github.com/ul/e2a4152959eeb3fcba04#file-responsive-fixed-data-table-js-L58 — simply remove that line
@ul, here is a your code adapted for reagent: https://gist.github.com/ducky427/10551a3346695db6a5f0. TL;DR - Facebook’s Fixed data table in Reagent
I'm kinda new to this, but for ease of use and for others, would it make sense to get https://www.npmjs.com/package/responsive-fixed-data-table onto http://cljsjs.github.io/?
Using reagent’s adapt-react-class gives you something which feels slightly more idomatic
yes it makes sense; it is in my TODO but will be totally happy if somebody will do it earlier
@ul, what about the resizable columns example here: http://facebook.github.io/fixed-data-table/example-resize.html
This is already kind of responsive, although there's no documentation on the actual configuration of that example
Ah I found the examples https://github.com/facebook/fixed-data-table/blob/master/site/examples/FlexGrowExample.js
@jonpither: I have extracted my table component, it is very simple but useful: https://github.com/hiram-madelaine/om-table
It just occured to me (I'm not a UI guy) that these days pagination is somewhat old fashioned, i.e. you should be able to rapidly scroll data in a table
A lazy sequence ought to be a good fit for this, i.e. realising the sequence results in ajax requests for more data..
are people using this approach? I.e. feed a lazy smart sequence into an existing table component
Given that I've just implemented a table for https://partsbox.io/ I'll pitch in — I went with showing about 30 rows (will adapt automatically to screen size later on) and having a "show more" button at the end. That way there is no pagination, which I think is better. All global ops such as search and select still work on complete data set, not just what is visible on the screen.
As for lazy sequences, kind-of. Laziness doesn't buy all that much if your tables are complex and have selectable rows. You might still have to deal with things that are off-screen but selected.
fwiw here's a sorted / paginated table i'm using : it's not very generic and is quite dependent on the api used to fetch data, but it's pretty easy to grok : https://github.com/trampoline/clustermap-components/blob/master/src/clustermap/components/table.cljs
If you often reconnect using the browser REPL, you may find this interesting: http://blog.fikesfarm.com/posts/2015-06-10-analyze-path-ftw.html
According to http://danielcompton.net/2015/06/10/clojure-reader-conditionals-by-example you can define several (:require ..)
per ns form. This helps reducing duplication when using reader conditionals. It looks like this does not work with the ClojureScript compiler.
Is that something that could be relaxed or a hack that should not work in the first place?
@jeluard: there are no examples there with multiple :require
s. And no we’re not going to change that.
the only enhancement currently on the table for consideration is macro inference for :refer
.
It allows to do something like (from the blog):
(ns poc.cml.sem
(#?(:clj :require :cljs :require-macros)
[poc.cml.macros :refer [go sync!]])
(:require
[poc.cml :refer [choose wrap]]
[poc.cml.util :refer [chan on put!]]))
This is a particular case as ClojureScript has a specific require-macros
syntax.Clojure ns
is incredibly permissive and we cannot desugar to runtime code as Clojure can.
last time I checked the ns
form in ClojureScript is the most complicated bit in the compiler.
i just published http://adzerk.com/blog/2015/06/splint-functional-first-aid-jquery/, a guide to using ClojureScript via splint.js in legacy jQuery apps
@alandipert: nice twist on Mori cool stuff.
@dnolen: thanks!
Am trying to build a cljsjs wrapper for https://github.com/vaiRk/responsive-fixed-data-table, but this JS file doesn't compile: https://github.com/vaiRk/responsive-fixed-data-table/blob/master/src/responsive-fixed-data-table.js
Hey, it’s that dude: https://twitter.com/qconnewyork/status/609083715864674304
mfikes: oh, yeah, bald guy in black t-shirt sitting in the back — he’s at all of these conferences
@jonpither it's a jsx file
dnolen: interesting way to do ‘eval' in cljs
@dnolen: about the analyze-path(s): why is that a different thing from source-paths?
@jeluard: I’ve updated the post to make it clear that cljs can only have one :require
. Thanks!
what does upstream-deps mean with reference to clojurescript? Getting some weird errors and that term keeps popping up, not sure what it means
@alwaysbcoding: need more information - like the actual error you are seeing
It's not in the actual error message, but it's in a lot of github comment threads about similar errors, was just curious what upstream-deps
meant, I had never heard the term before.