--
You received this message because you are subscribed to the Google Groups "meteor-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meteor-talk...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "meteor-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/meteor-talk/nhulj4Zh1fU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to meteor-talk...@googlegroups.com.
Hi Adrian,Thanks for the feedback, its always appreciated. The current iteration of the package already accounts of paginating and searching over very large collections.If you check out in the example, this is where I am using a server side datasource that is auto paged / sorted / and filtered via the datatables package.I've tested this with collections containing hundreds of thousands of rows, and as long as you are keeping the number of fields you are searching low.Ideally though you will want to shrink the dataset as much as possible using the query option. This way you can show a lot of columns, and still have live search.If you are more interested in how the pub / sub logic works you can check out these methodsTemplate.dataTable.setSubscriptionAutorun ( https://github.com/LumaPictures/meteor-jquery-datatables/blob/master/lib/datatables.client.coffee#L249 )and on the serverDataTable.publish ( https://github.com/LumaPictures/meteor-jquery-datatables/blob/master/lib/datatables.server.coffee#L13 )This whole project is still very much a work in progress, so feel free to give input on anything that seems clunky or unnecessarily confusing to implement.
On Fri, Apr 25, 2014 at 5:55 PM, Adrian Lanning <alan...@gmail.com> wrote:
Very cool! Regarding paging/filtering, I didn't see it in your roadmap but any plan to integrate with Meteor's publish to avoid pushing all data to the client?Also, your example site is really impressive! Fast and really neat to see all those disparate components pulled together. I think Blaze is living up to its name. Modal dialogs in particular used to be a pain with Spark so its nice to see what appears to be stock jquery-ui just work.
I did notice one small thing, the text color of the modal form's input fields appears to be the same as the background. Either that or typing isn't working for them in Chrome on OSX. http://luma-ui.meteor.com/interface-components/visuals#form_modal
(Be sure to include a license in your luma-ui repo)
--
{{> dataTable selector="example" columns=pages.columns rows=pages.rows }}
$( '#example tbody' ).on 'click', 'tr', ->
name = $( 'td', @ ).eq( 0 ).text()
console.log "You clicked on #{ name }'s row"
options =
initComplete: ->
api = @api()
api.$( 'td' ).click -> api.search( @innerHTML ).draw()
{{> dataTable options=options columns=pages.columns rows=pages.rows }}
The query parameter for reactive tables is now reactive ( duh ). My goal was to have the table impose no structure on the query and just use raw mongoDB selector.
The basic idea is that you set a session variable ( or some other reactive datasource ) to your initial query and then use that var as the query parameter for the table component. Whenever the query parm changes the table will automagically rerender using the new query to fetch its dataset.
You can see a basic implementation of this there. In this example the table controls just extend the query object with whatever value they are set to. I tried to include examples of all the common control types, but if you think of any that I missed feel free to let me know.
Currently applying the filter can cause a somewhat janky table reload depending on what its contents looks like, this is something I plan on addressing ASAP.
I changed the way that the DataTable class publishes data. Instead of publish()
being a static method it is now an instance method that requires a DataTable instance. I think this is a more sustainable structure that will allow for a lot more flexibility in the future.
Here is how you instantiate a server DataTable component.
RowsTable = new DataTableComponent
subscription: "rows"
collection: Rows
query:
someProperty: "someValue"
otherProperty: $regex: "value"
nested:
property: $gte: 0
The query you define on the server will limit your dataset to the client while preserving all of the pagination, sorting, and filtering.
The DataTableComponent is now classy cased along with the actual template name.
{{> DataTable options }}
instead of
{{> dataTable options }}
--