Requested unknown parameter 'orderid' for row 0, column 0.

Requested unknown parameter 'orderid' for row 0, column 0.

Ed MartinEd Martin Posts: 23Questions: 5Answers: 0

I want to use leftJoin to add a table to my form to provide a Customer Name on which to allow filtering. I am getting an error indicating a problem with the field on which I joined my first table. I am getting the error message:

DataTables warning: table id=delivery - Requested unknown parameter 'orderid' for row 0, column 0. For more information about this error, please see http://datatables.net/tn/4

My data array looks correct with the only change being the new table name for the joined field

{"data":[{"DT_RowId":"row_1","orders":{"orderid":"2"},"delivery":{"orderdate":null,"quantity":"12","cropid":"2565","product":"Hemerocallis Bold Tiger `Bold Tiger` #1 2017-02-01","price":"0.00"}},{"DT_RowId":"row_2","orders":{"orderid":"2"},"delivery":{"orderdate":null,"quantity":"11","cropid":"2376","product":"FERN Asparagus densiflorus `Sprengeri Compacta` #1 2018-11-13","price":"4.75"}},{"DT_RowId":"row_3","orders":{"orderid":"2"},"delivery":{"orderdate":null,"quantity":"4","cropid":"2833","product":"Lagerstroemia indica `Centennial Spirit` Tree; #15 2018-05-28","price":"58.00"}},{"DT_RowId":"row_4","orders":{"orderid":"2"},"delivery":{"orderdate":null,"quantity":"2","cropid":"2842","product":"Lagerstroemia indica x fauriei `Muskogee` Tree; #15 2018-05-28","price":"58.00"}},{"DT_RowId":"row_5","orders":{"orderid":"2"},"delivery":{"orderdate":null,"quantity":"4","cropid":"2853","product":"Lagerstroemia indica x fauriei `Tuscarora` Tree; #15 2018-05-28","price":"58.00"}},{"DT_RowId":"row_6","orders":{"orderid":"2"},"delivery":{"orderdate":null,"quantity":"2","cropid":"2157","product":"Citrus aurantiifolia `Mexican Lime` Patio Tree; #20 2018-07-27","price":"160.00"}},{"DT_RowId":"row_7","orders":{"orderid":"2"},"delivery":{"orderdate":null,"quantity":"12","cropid":"2170","product":"CITRUS Fortunella obovata Patio Tree; #10 2018-08-22","price":"67.00"}},{"DT_RowId":"row_8","orders":{"orderid":"2"},"delivery":{"orderdate":null,"quantity":"11","cropid":"2350","product":"LEMON GRASS Cymbopogon citratus #1 2019-03-18","price":"4.75"}},{"DT_RowId":"row_9","orders":{"orderid":"2"},"delivery":{"orderdate":null,"quantity":"12","cropid":"2600","product":"GRASS Acorus gramineus `Ogon` #1 2018-03-15","price":"4.75"}},{"DT_RowId":"row_10","orders":{"orderid":"2"},"delivery":{"orderdate":null,"quantity":"10","cropid":"2941","product":"Photinia x `Fraseri` Tree; #5 2018-03-17","price":"24.00"}}],"options":[],"files":[],"searchPanes":{"options":[]}}

I have gone over the documentation, but I am probably missing something in the join process. Any advice? Thanks in advance.

Answers

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951
    edited May 2020

    Looks like you have nested objects. Here is an example of how to use columns.data with nested objects.

    Kevin

  • Ed MartinEd Martin Posts: 23Questions: 5Answers: 0

    Thanks for the quick response Kevin, I see the example of nested data in the documentation, but it looks like it is referring to a JSON array structure. Is this what is happening when I joined the orders table to the delivery table? Does the join cause the resulting two data fields ("orderId") to be nested? Sorry this is a bit new to me, I appreciate your help.

  • Ed MartinEd Martin Posts: 23Questions: 5Answers: 0
    edited May 2020

    I now see that I have conflicts in my JS file caused by the introduction of another field with the same name. I had to prefix the specific table name on each of the data: elements.

    Thanks for pointing me in the right direction Kevin!

This discussion has been closed.