Unable to automatically determine field from source. Please specify the field name

Unable to automatically determine field from source. Please specify the field name

sergedasergeda Posts: 42Questions: 16Answers: 0
edited November 2014 in Editor

I've got this error on editor window open.
Here are my
datatable columns

        "columns": [
            { "data": "season_start" },
            { "data": "season_end" },
            { "data": "p" },
            { "data": "min" },
            { "data": "f" },
            { "data": "a" },
            { "data": "yc" },
            { "data": "rc" },
            { "data": "r" },
            { "data": "g" },
            { "data": "y" },
            { "data": "ws"},
            {
                "data": null,
                defaultContent:'<span  class="action"><span class="glyphicon glyphicon-edit edt_statistic"></span> <span class="glyphicon glyphicon-remove del_statistic"></span></span>'
            }
        ],

and my editor columns:

        fields: [
            {
            label: "P:",
            name: "p"
        },

            {
            label: "MIN:",
            name: "min"
        }, {
            label: "F:",
            name: "f"
        }, {
            label: "A:",
            name: "a"
        }, {
            label: "YC:",
            name: "yc"
        }, {
            label: "RC:",
            name: "rc"
        }, {
            label: "R:",
            name: "r"
        }, {
            label: "G:",
            name: "g"
        }, {
            label: "Y:",
            name: "y"
        }, {
            label: "WS:",
            name: "ws"
        },
            {
                label: "Season start:",
                name: "season_start",
                type: "date",
                "opts": {
                    format: 'yyyy',
                    minViewMode: 'years'
                }
            },
            {
                label: "Season end:",
                name: "season_end",
                type: "date",
                "opts": {
                    format: 'yyyy',
                    minViewMode: 'years'
                }
            }
        ]

What is wrong with it? Please, help me

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Can you link to the page in question please? Or at least perhaps show us the full code - specifically I'm interested in how you are adding the event listener for triggering the inline edit.

    It looks like it should work just fine for columns such as f and min as far as I can see.

    Also, have you read the tech note that explains this error?

    Allan

  • sergedasergeda Posts: 42Questions: 16Answers: 0
    edited November 2014

    Allan, can give link with password to you. Can't give it to the public.
    Here is the code of event listener:

        container.find('#statistic_list').on('click','tbody td',function (e) {
            container.editor.inline( this,$(this).data('field') );
        } );
    
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Okay - so that is going to make every cell in the table editable. Can you confirm that $(this).data('field') returns the field name you want to edit? A simple console.log would confirm it.

    Allan

  • sergedasergeda Posts: 42Questions: 16Answers: 0
    edited November 2014

    Actually this inline edit working fine except select date fields but on opening the same table through

            container.editor
                .title( 'Edit record' )
                .buttons( { "label": "Update", "fn": function () { container.editor.submit() } } )
                .edit( $(this).parents('tr') );
    

    show this error in console

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Answer ✓

    show this error in console

    What error?

    It would be very useful if you could link me to the page please. Click on my name above and then "Send message" to PM me the details.

    Allan

  • sergedasergeda Posts: 42Questions: 16Answers: 0

    Thank you Allan for your help.
    I have found the cause of the problem.

This discussion has been closed.