Yet another Row id question (and suggestion)

Yet another Row id question (and suggestion)

realviewrealview Posts: 6Questions: 0Answers: 0
edited June 2011 in DataTables 1.8
I suggest that for all your server side examples you show the data that is returned by the PHP rather than rely on PHP itself. For someone not using PHP your documentation is terrible because it is so vague and incomplete in this way. Yet DataTable is great it's an incredible and unnecessary hassle without clearing up this issue. People don't need PHP they need a clear definition of the input expected. Then any tool will work. What should be a 10 second understanding becomes days of hassle for nothing. I can't even begin to guess how I would get the DT_RowsID passed back properly in the data and I don't find a simple example that makes this clear and simple is all it takes.

Also, why isn't there a aDTRowID attribute with a parameter of string for column name or number for column index? Please explain and correct this problem. Thanks!

Replies

  • allanallan Posts: 63,678Questions: 1Answers: 10,497 Site admin
    There is documentation for the values sent to the server and what is expected back available here: http://datatables.net/usage/server-side . What do you feel could be added to that to make the input and output values clearer? Also it's trivial to look at my examples with Firebug and see the format that they are using.

    As you rightly note the PHP examples are just that - examples. There is a "gallery" of other scripts available here: http://datatables.net/development/server-side/ which might be of use.

    [quote]realview said: Also, why isn't there a aDTRowID attribute[/quote]

    Do you mean for assigning an ID to an individual cell? There is nothing stopping you from adding this functionality with fnRowCallback or a multitude of other ways, it just isn't something which is built in.

    Allan
  • realviewrealview Posts: 6Questions: 0Answers: 0
    Thanks for trying but please take it to heart, your responses have not provided any useful information at all. You are very familiar with the tools and environment and take for granted how do to things. I'm just learning Jquery, not familiar with firebug, have limited php exposure but I've developed software in other venues for 30 years. You documentation is PHP oriented for a product that has nothing to do with php. Your product simply expects data in a particular format using a particular protocal. I'm still struggling to find out what that format is and a few simple lines of data would tell me everything I need to know. Don't take it personally, I'm trying to help better your product.
  • realviewrealview Posts: 6Questions: 0Answers: 0
    I'm trying to use the automated method of passing in the rowid. If I can hide the row id and then pass it to the server for an update of the row with jseditable that would be great. The fact that it isn't clear how to do these things is something to take to heart. A good teacher is the one that seeing the student failing to learn realizes they (the teacher) are the problem for failing to teach effectively. The bad teacher blames the student for not learning the teachers way.
  • realviewrealview Posts: 6Questions: 0Answers: 0
    Also your examples like asp.net are too convoluted. Examples don't need to show database calls, etc.. Just what it takes to format a class with a few rows so datatable understands it. Your not teaching people how to use perl or .net or whatever, your showing them how to get and format the data correctly for datatable.
  • allanallan Posts: 63,678Questions: 1Answers: 10,497 Site admin
    Thank you for the feedback - I'm sorry that my comment didn't help. I have a limited amount of time that I can dedicate to DataTables since I need to work to pay the bills. If I didn't then perhaps I would have more time to write better documentation and answer support questions in the forum.

    Here is an example of the JSON structure which is used on this page: http://datatables.net/release-datatables/examples/server_side/ids.html

    [code]
    [
    {
    "DT_RowId": "row_7",
    "DT_RowClass": "gradeA",
    "0": "Gecko",
    "1": "Firefox 1.0",
    "2": "Win 98+ / OSX.2+",
    "3": "1.7",
    "4": "A"
    },
    {
    "DT_RowId": "row_8",
    "DT_RowClass": "gradeA",
    "0": "Gecko",
    "1": "Firefox 1.5",
    "2": "Win 98+ / OSX.2+",
    "3": "1.8",
    "4": "A"
    }
    ]
    [/code]

    That data structure is just JSON. Any server-side language can output such a structure. That is what is consumed by DataTables. The 0, 1 etc indexes can be altered to anything you want using the mDataProp option - explained here: http://datatables.net/blog/Extended_data_source_options_with_DataTables

    Allan
  • realviewrealview Posts: 6Questions: 0Answers: 0
    Thanks for trying this link provided A solution : http://ominian.com/2011/03/31/jquery-datatable-plugin-quick-notes/
  • realviewrealview Posts: 6Questions: 0Answers: 0
    Your last example is very helpful -- I'll test that also... I appreciate your patience...
This discussion has been closed.