KnockoutJS

KnockoutJS

edited May 2011 in General Posts: 8
Hello,
great work Allan, DTs are really good. We are using them extensively in our project, so I persuaded my company to donate :)

Has anyone combined DT and knockoutJS?! Here is an example http://jsfiddle.net/6Uf9S/15/
Is this maybe the way to go forward? Altough its too late for me to change my project, I played with it, and got some simple behavior like add, delete...

Since there is no thread about this, maybe we could share our experience combining these two.

Replies

  • Posts: 3
    I've created a Knockout.js binding for DataTables - its available under the MIT licence from my blog: http://www.joshbuckley.co.uk/2011/07/knockout-js-datatable-bindings/
  • Posts: 22,298
    @Josh: Very nice! I'll add a link to the DataTables news feed if you don't mind. I'll take a closer look at what you've done later on, but that looks very useful indeed - thanks for sharing it!

    @mirkec: Great to hear that you are enjoying using DataTables! And thanks for convincing your company to make a donation! Let us know how you get on with the integration with knockoutJS.

    Allan
  • Posts: 3
    Allan, that'd be excellent!

    I'm sure there are improvements to be made, so traffic coming from this site with suggestions or requests would be useful.
  • Posts: 22,298
    Just added. I've recently been looking at Backbone.js integration and DataTables so it is interesting to see a Knockout.js version.

    Interesting comment in your post:

    Today, I needed a table widget. There isn’t currently one available in jQuery UI, though one is being developed, so I searched for an alternative.

    Would you have searched for an alternative if jQuery UI did have their table control available just now? Obviously when it is available it is going to attract a lot of attention away from DataTables, so I'm curious to know view points!

    Regards,
    Allan
  • Posts: 3
    Cool thanks :)

    Honestly, I probably wouldn't have. My (current) needs for a data table are fairly simple, so any jQuery UI table widget would probably suffice, as I would imagine it to be fairly simple.

    However, DataTables does offer a lot of customisation, which I think may be its USP. Once the jQUI version is out, it may be worth releasing a jQUI->DataTables guide, or even a wrapper so DataTables can accept the jQUI's api, so people can "upgrade" easily.
  • edited August 2011 Posts: 8
    Back from holidays, so :) :

    Would you have searched for an alternative if jQuery UI did have their table control available just now?
    That really depends on users needs, we have complete DevExpress controls, but I didn't like their MVC controls(mind that, WinForms are excellent), so I was trying to find controls that suit my needs, and are good for development and later upgrade/support. Currently, I'm working with jQuery UI + DataTables, and I'm very satisfied.

    In some scenarios DT and Knockout are overlapping(example from past project: I have form with list of objects (in DT1), when I click add connection, modal dialog opens with list of all available objects (in DT2 for search/page...), in that DT i have add link in first column and after I click it, that row is added to first list of objects (DT1) ). -> Both simple and effective to implement in DataTables alone and also combining DT & KO.

    But now I have more complex scenario with other controls using same data, so I'm going with KO + DT, and I'll post my experience here.

    Keep up the good work.
  • Posts: 73
    My opinion on the jQuery UI tables is: Unfortunately, they're the 800 lb Gorilla... So, you'll probably have to change your stuff to work with whatever they do so that the experience is consistent and things such as that. I'm sure you will have plenty of features that won't be present in their version, but the question is whether or not it will be worth it for you to do so much refactoring if it will also abandon your current code base...

    Tough position..
  • edited December 2011 Posts: 1
    Heya @mirkec,

    I've just published a pretty fully featured Knockout JS data binding that integrates with DataTables pretty nicely.

    You can check out the source here: https://github.com/CogShift/Knockout.Extensions

    And the Demos here: http://jsfiddle.net/ducka/haq2y/ and here: http://jsfiddle.net/ducka/fPaQs/

    Cheers!
  • Posts: 73
    duckaroy - good stuff. Hope to make use of it soon!
  • mgmg
    edited June 2012 Posts: 47
    FYI - when I tried to visit Josh Buckley's site just now, Kaspersky Anti-Virus gave a warning about
    "malicious HTTP object ... detected: Trojan program:'HEUR:Trojan.Script.Iframer' (modification)".
  • Posts: 1
    mg. I noticed this from 3 different anti virus systems (work and 2 different home computers) as well. However, I knew the site can be trusted (I have visited his blog quite a few times) and have noticed the warnings are intermittent. I don't know if Josh is still following but I will try to investigate what is throwing this and keep everyone posted.
  • hi duckaroy,
    i just checked out your work on github and its a great idea
    but while fiddling with it on jsfiddle i found no way to set the option for datatable like
    "sScrollY": 200,
    "bJQueryUI": true,
    "sPaginationType": "full_numbers"
    can u suggest some thing
  • mgmg
    Posts: 47
    Any progress made on datatables and knockout integration?
  • Posts: 22,298
    Not yet. Watching out for more on this topic after the release of 1.10.

    Allan
This discussion has been closed.