When using columns.render I get "Requested unknown parameter"

When using columns.render I get "Requested unknown parameter"

mbrewermbrewer Posts: 8Questions: 2Answers: 0

I'm down the rabbit hole on this one.

I have a nested array. The nested array (schedules) has multiple schedules for each outer array (cycles). I need to loop through "schedules" and display every schedule returned for each cycle . So each row will have a schedules column with a list of linked schedules.

View code here:
live.datatables.net/jibedupu/2/edit?html,js,console,output

Thanks!

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,167Questions: 26Answers: 4,921
    Answer ✓

    You need to restructure your loop to build the schedules to something like this:

                    render: function(data,row,type){
                      var sched_link = "<ul>";
                        $.each(data, function(i)
                        {
                          sched_link += "<li><a href='results.php?schedid="+data[i].cobalt_duesscheduleId+"'>"+data[i].cobalt_name+"'</a></li>";
                          
                        });
                      sched_link += "</ul>";
                      return sched_link;
                    }
    

    Updated example:
    http://live.datatables.net/dusezoxa/1/edit

    Kevin

  • mbrewermbrewer Posts: 8Questions: 2Answers: 0

    That certainly did it! Thanks Kevin!

This discussion has been closed.