tmjohnson57 / jquery-datatables-editable

Automatically exported from code.google.com/p/jquery-datatables-editable
0 stars 0 forks source link

makeEditable should be able to use mData name for the columnName being updated #135

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Create a table that uses mData to identify the columns in the JSON data 
returned from the server.
2. Add makeEditable
3. When you edit a cell, the columnName parameter gets set to the value of the 
TH for the column.
4. This can be worked around by setting the sName property in the dataTable 
aoColumnDefs.  However, this requires you to set the name for the column twice. 

What is the expected output? What do you see instead?

You should be able to tell makeEditable to use the mData column name as the 
columnName for updates.

What version of the product are you using? On what operating system?

2.3.2, with Chrome web browser running on Windows 7

Please provide any additional information below.

Line 252-->254 of this version of makeEditable could be modified from:

var sColumnName = oTable.fnSettings().aoColumns[columnId].sName;
if (sColumnName == null || sColumnName == "")
  sColumnName = oTable.fnSettings().aoColumns[columnId].sTitle;

To:

var sColumnName = oTable.fnSettings().aoColumns[columnId].mData;
if (sColumnName == null || sColumnName == "")
  sColumnName = oTable.fnSettings().aoColumns[columnId].sName;
if (sColumnName == null || sColumnName == "")
  sColumnName = oTable.fnSettings().aoColumns[columnId].sTitle;

I think mData should take precedence over sName, but that might not be right.

Original issue reported on code.google.com by steve.ja...@gmail.com on 1 Nov 2012 at 3:48