Problem With DOM Sourced Data and Form Submission Field Names

Problem With DOM Sourced Data and Form Submission Field Names

delusivedelusive Posts: 3Questions: 1Answers: 0
edited May 2014 in Editor

I am trying to use a DOM sourced table with an editor.

The following example page isn't working either. (It works if you surround the data/name option column index with quotes)
http://editor.datatables.net/examples/advanced/htmlTable.html

I am defining fields like this in the editor

  fields: [
    {
      label: "Name"
      name: "name"
      data: "0"
    }

The documentation states that the data option is to fetch the data and the name option is to name the form submitted fields. The problem is the form is being submitted with 0 and 1 (the column indexes) as the names of the form fields instead of the name option.

i.e. form data is:

action:edit
data[0]:namevalue
id:row_1

instead of

action:edit
data[name]:namevalue
id:row_1

Am I understanding things correctly?

Thanks,
Darryl.

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    edited May 2014

    Hi Darryl,

    Thanks for bringing this up. The honeymoon period had to end - first bug in Editor 1.3! There is an error when checking for a field name. Your workaround of giving it as a string is perfect! I'll have a fix in the next release.

    I've just tried the reproduce the name issue (your unstinting is absolutely spot on!) and haven't been able to. It unfortunately seems to work as expected for me. Are you able to link me to the page so I can take a little look at it?

    Thanks,
    Allan

  • delusivedelusive Posts: 3Questions: 1Answers: 0

    Allan, thanks for the quick reply.

    I have put up a Gist of my initialization javascript (coffeescript), for datatables and the editor:
    https://gist.github.com/anonymous/a708df16c2f0b56838db

    I am working on exposing the page online, in the meantime can you see anything from this instantiation that might be off?

    Thanks,
    Darryl.

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    I'm afraid, as far as I can see, everything looks like it should work there. I do feel you probably have found a bug here, but I can't put my finger on what it is...! If you are able to send me a link to a test case, what would be great.

    Thanks,
    Allan

  • delusivedelusive Posts: 3Questions: 1Answers: 0

    Allan I have sent a PM to you with the link to the page that I exposed.

This discussion has been closed.