Newbie: Poor docs!! many examples, but none of them gives basic/setup and other info for a newbie.

Newbie: Poor docs!! many examples, but none of them gives basic/setup and other info for a newbie.

srkprivsrkpriv Posts: 2Questions: 0Answers: 0
edited January 2014 in General
I am a newbie JQuery Datatables (and have some basic knowledge on JQuery) and having hard-time understanding the setup and required js files and dependencies; I see the documentation is missing in terms of how to consume JQuery and JQuery database (dependencies and how to setup them locally and so on); I have setup now (after trial and error from different examples over the web)

Most of the example use a '#example' table that is very rudimentary. Most real world application require pulling the data from the server and updating them in a grid and doing a lot of interactions. I would be wonderful to see a documentation that explains a setup for the real scenario.

I am going through sites after sites to see the same examples are regurgitated every where and the examples that seem to pull data from server they are not complete, it is just pieces of the example. The site just says the 'datatable' is easy / and easy and that is only part that is easy... (when writing documentation please write from a consumer point and not from software developer (your) point of view)

I am also not able to find a single documentation that tells me which files (js files) have to be consumed (at a bare minimum requirements and dependencies)

Is there a good incremental documentation/examples that shows installation, initial setup, examples for static and then server side so we can consume this as easily as possible (and that is how it should be I suppose).

Thanks.

Replies

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    [quote]....I have setup now....[/quote]
    So what exactly is your problem? Can you not build on what you have set up?
  • netametanetameta Posts: 39Questions: 0Answers: 0
    i think he just wanted to express how unhappy he is with the documentation.
  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin
    edited January 2014
    I'm aware that the documentation it's currently far from brilliant. I'm the prosess just now of completely rewriting the documentation to make things easier to get going. I should be able to publish a preview next week.

    I'm hoping that the new documentation will really help and I will hugely appreciate feedback then they are available. The forum takes up so much time at the moment that there isn't the time to do documentation and development as much as I would like. That's something that I need to address, with the current hope that better document will save everyone's time...

    Having said that, I will always assume a base level of using jQuery and JavaScript. There are millions of books available to teach those, and writing the DataTables documentation alone is a mammoth task!

    Allan
  • srkprivsrkpriv Posts: 2Questions: 0Answers: 0
    edited January 2014
    Thanks Allan. That would really be helpful. Obviously, documentation is a mammoth task, no doubt about it. Sorry, I did not mean to be that crude on my comments. From my side, I have a very tight deadline...

    Knowing JQuery or JS is one thing.. For someone who is new to a framework it takes a lot of effort to understand things.. The documentation should be written from a consumer point of view...

    Let me give an example of what I was talking about...

    Your example of "Initialization Code" (I customized this and changed it to 'mytable' and other attributes...)
    $(document).ready(function() {
    $('#example').dataTable();
    } );

    This is good for basic example, but, which js to include, what files to download... This part was okay... Finally, I got this part working by looking at various blogs/sites etc (I made a few mistakes myself and that prolonged my issues as well).

    Now, I am trying to make my table editable;
    Initialisation code (Your example) -
    $(document).ready(function() {
    /* Init DataTables */
    var oTable = $('#example').dataTable();

    // Added this part into the code.. (not working)
    /* Apply the jEditable handlers to the table */
    $('td', oTable.fnGetNodes()).editable( '../examples_support/editable_ajax.php', {
    ...... more...h

    I use this code, and my table does not become editable... how do I apply jeditable handler? how do I debug? where would I look.. what am I missing?... many other examples/sites/blogs later... I am still searching... because most other examples are regurgitation of the same examples you have given... And, there is one other example which calls a 'makeEditable', but, unfortunately, that talks about data manager plugin.. I don't know whether that is same API or different...

    one other example talks about using the class value (".editable") obviously I know it is a css class object... but which one do I use "tr td" or ".editable" (may be both will work) but changing each time and trying different things without knowing concretely... ? I did change this and tried but still did not work... don't know what was the issue... (may be it is a simple step I missed, could be my mistake, but could not proceed further)

    also many of your examples uses php... I had to work with Java/Struts/JSP etc... I actually know php so I was able to look and understand certain things which helped not all may know php...

    My suggestion as a start would be please show a full example (entire source code in HTML/Javascript) for a basic grid, with static data (non-server side) and another one with server side processing (both editable and non-editable with all their dependencies). People can then customize the same to their target environment (jsp, php, ruby whichever)...

    Hope this helps...
    Thanks.
  • AdictoDigitalAdictoDigital Posts: 1Questions: 0Answers: 0
    edited January 2014
    Dear srkpriv, I agree with you 100%
  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin
    Heh, this a is a great example of the difficulty of writing good documentation!

    > This is good for basic example, but, which js to include, what files to download... This part was okay...

    I've often been told the exact opposite! This part will, without doubt, be much easier in the new documentation, one way or another.

    > I use this code, and my table does not become editable... how do I apply jeditable handler? how do I debug? where would I look.. what am I missing?... many other examples/sites/blogs later... I am still searching... because most other examples are regurgitation of the same examples you have given...

    There are only two jEditable examples on this site I think (rehashed in the forums a lot probably), one with client-side processing and one with server-side. They are, I fully acknowledge incomplete. The new site will be using Editor ( https://editor.datatables.net ) as the editing component for DataTables, since I am able to fully support that software.

    > And, there is one other example which calls a 'makeEditable', but, unfortunately, that talks about data manager plugin.. I don't know whether that is same API or different...

    The `makeEditable` extension to DataTables is 3rd party (deprecated by its author) software, which shouldn't have any documentation what so ever on this site. It is mentioned in the forums a few times, but isn't something I can support.

    > also many of your examples uses php... I had to work with Java/Struts/JSP etc... I actually know php so I was able to look and understand certain things which helped not all may know php...

    Agreed! I have to use something though and don't want to hold development back by writing the same thing in 5 different languages. This also is something I need to figure out a way of resolving.

    > My suggestion as a start would be please show a full example (entire source code in HTML/Javascript) for a basic grid, with static data (non-server side)

    That basically is the plan. And then built it up from there.

    Thanks for the feedback!

    Regards,
    Allan
  • bohrsmodelbohrsmodel Posts: 4Questions: 0Answers: 0
    I agree. It's quite frustrating. I wish they would post a simple working sample folder I could just plop into my www folder that includes a small sql sample database I can just import.
  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin
    edited February 2014
    The new documentation might help: http://next.datatables.net/manual/installation ?

    The SQL used for DataTables server-side processing is used here: https://github.com/DataTables/DataTables/blob/master/examples/server_side/scripts/data.sql .

    Or are we talking about editing? In which case: https://editor.datatables.net/tutorials/installing

    Failing that - what can I improve?

    Allan
  • bohrsmodelbohrsmodel Posts: 4Questions: 0Answers: 0
    Try this.

    http://code.google.com/p/jquery-datatables-in-line-editing/downloads/detail?name=CreativePathExample.zip&can=2&q=

    It's a real basic working example that reads/write from a database. I got this up and running really quick. I wish I had stumbled on this earlier. It would have saved me a few days of work not to mention frustrations. It's exactly what I wished for, which was an example I could just plop into my www folder that includes a database I could just import.

    Just follow the directions in readme.php. Only problem I encountered was an error when importing the sql file into mysql database in phpmyadmin was that it didn't recognize " latin1$$". This was easily solved by removing "DEFAULT CHARSET=latin1$$" from the file.
This discussion has been closed.