stephenswilliams / jquery-datatables-editable

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

Workaround for adding new row when ColVis plugin is used #62

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build an editable table with unique validation methods per column, defined 
in aoColumns
2. Hide the first two columns using fnSetColumnVis( 0, false )
3. Add a New Record using the Add a Record Button

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

I would expect that the data be injected into the table, including the data on 
the hidden column, and that the existing aoColumns setup would propogate to the 
new row

Instead, while the data makes it into the correct columns (even the hidden 
ones), it appears that you re-apply the aoColumns configuration to the new row, 
and it does not take into account the hidden columns.. thus offsetting the 
desired validation methods by the number of hidden columns for the new row 
only. 

My workaround has been to use the fnOnAdding to unhide the columns, and then 
fnOnAdded to hide the columns again. 

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

1.3 on FreeBSD

Please provide any additional information below.

Original issue reported on code.google.com by ras...@gmail.com on 9 Sep 2011 at 5:17

GoogleCodeExporter commented 9 years ago
This may be related to issue 44 ?

Original comment by ras...@gmail.com on 9 Sep 2011 at 5:35

GoogleCodeExporter commented 9 years ago
You are right this is a problem. When ColVis plugin is applied cells are 
actually removed from the DOM and therefore cannot be accessed by the plugin in 
order to apply editable. Does your workaround works both when column is hidden 
programatically and when user manually hides/shows columns?
Could you please post the code you have added?
Currently I cannot cover this case too because ColVis is not standard feature, 
however yur code could be used as a workaround.

Regards,
Jovan

Original comment by joc...@gmail.com on 14 Sep 2011 at 9:22