KnockoutJS

KnockoutJS

mirkecmirkec Posts: 8Questions: 0Answers: 0
edited May 2011 in General
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

  • JoshJosh Posts: 3Questions: 0Answers: 0
    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/
  • allanallan Posts: 63,434Questions: 1Answers: 10,458 Site admin
    @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
  • JoshJosh Posts: 3Questions: 0Answers: 0
    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.
  • allanallan Posts: 63,434Questions: 1Answers: 10,458 Site admin
    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
  • JoshJosh Posts: 3Questions: 0Answers: 0
    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.
  • mirkecmirkec Posts: 8Questions: 0Answers: 0
    edited August 2011
    Back from holidays, so :) :

    [quote]Would you have searched for an alternative if jQuery UI did have their table control available just now?[/quote]
    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.
  • tommcktommck Posts: 73Questions: 0Answers: 0
    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..
  • duckaroyduckaroy Posts: 1Questions: 0Answers: 0
    edited December 2011
    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!
  • tommcktommck Posts: 73Questions: 0Answers: 0
    duckaroy - good stuff. Hope to make use of it soon!
  • mgmg Posts: 47Questions: 0Answers: 0
    edited June 2012
    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)".
  • ayouker1ayouker1 Posts: 1Questions: 0Answers: 0
    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.
  • andiesdenandiesden Posts: 2Questions: 0Answers: 0
    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: 47Questions: 0Answers: 0
    Any progress made on datatables and knockout integration?
  • allanallan Posts: 63,434Questions: 1Answers: 10,458 Site admin
    Not yet. Watching out for more on this topic after the release of 1.10.

    Allan
This discussion has been closed.