uncaught exception: Unable to automatically determine field from source.

uncaught exception: Unable to automatically determine field from source.

ShaneBrennanShaneBrennan Posts: 40Questions: 14Answers: 1

Hopefully this will be a quick fix... hopefully

Full error I'm getting: "uncaught exception: Unable to automatically determine field from source. Please specify the field name"

I have a datatable with a field showing the concatenation of three fields, using the following:

   var table = $('#example').DataTable( {
      dom: "Bfrtip",
      ajax: "../server_side/scripts/ET_ASBresultsForBuilding.php?jobRef=P18-00053",
      iDisplayLength: 25,
      columns: [
         { data: null, render: function ( data, type, row ) {
                return data.tblASBassets.roomLocation;
            } },
         { data: null, render: function ( data, type, row ) {
                return data.tblASBassets.area + ', ' +data.tblASBassets.item + ', ' + data.tblASBassets.material;
            }, editField: null },

on the editor I've listed the three fields:

   editor = new $.fn.dataTable.Editor( {
      ajax: "../server_side/scripts/ET_ASBresultsForBuilding.php?jobRef=P18-00053",
      table: "#example",
      fields: [ { name: "tblASBassets.roomLocation", type: "display" },
                { name: "tblASBassets.area", type: "display" }, 
                { name: "tblASBassets.item", type: "display" }, 
                { name: "tblASBassets.material", type: "display" },

When I click on the datatable's field

I get the following

I know it's something to do with the editor trying to find the corresponding Editor Field - but because it's three fields in 1 I get the exception error.... all I want to do really is say - just show this at text - I don't want to edit it.

Anyone got any ideas? As ypou ca see I even tried setting the editfield parameter to null with no effect

Thank you in advance for any help given

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 48,664Questions: 1Answers: 7,069 Site admin
    Answer ✓

    Hi,

    If you don't want to be able to edit that field inline (or bubble) then use this technique to ensure that you don't actually attempt to trigger editing on that field.

    If you do want to make it editable, you would need to use bubble editing since inline editing only supports a single field at a time. This example shows how multiple fields can be editable in a single bubble from a column.

    Regards,
    Allan

Sign In or Register to comment.