Open GoogleCodeExporter opened 9 years ago
Hi,
Currently DT editable plugin is not compatible with column visible and column
reorder plugins. Problem is in configuration of editable plugin - it uses
aoColumns for the column editor definition however these indexes are mismatched
if one of these two plugins change s data table column order.
I'm considering this as future enhancement but until now I have not suceed to
make them compatible.
Regards,
Jovan
Original comment by joc...@gmail.com
on 7 Mar 2012 at 11:34
Hi Jovan,
Thank you for your quick response regarding my question!
As a follow up, I need to keep the Column Show/Hide and Column Reorder
since the previous release supported this. Would you recommend or have any
other thoughts on how to implement the Edit ability on a Datatable column
while keeping the Column Reorder and Show/Hide features?
Thanks again.
-thuy
On Wed, Mar 7, 2012 at 3:35 PM,
<jquery-datatables-editable@googlecode.com>wrote:
Original comment by thuyduon...@gmail.com
on 8 Mar 2012 at 6:12
hi there, i had (reluctantly) to modify the editable to support using the new
row form also for editing/updating; and came to the issue with the colreorder
problem too. i dont use inline editor in this table, but i solved the problem
for me by adding a 'rel' attr to the original table header when creating the
table, representing the original column index. and when adding a new row
(_fnOnRowAdded), i check if the th node has that rel attribute, and if, get the
current column index of this column and use it..
maybe this is a suggestion to handle this issue ??
sample (around line 340):
function _fnOnRowAdded(data) {
....
var rel = $(this).attr("rel"); // original column index
for (n=0;n<iColumnCount;n++) // loop through columns
{
if ($(oSettings.aoColumns[n].nTh).attr("rel") !== undefined) {
var threl=$(oSettings.aoColumns[n].nTh).attr("rel");
if (threl == rel)
{
// example: rel attrib is 2 because it was the 3rd column, now
// moved with colreorder as 1st column;
// threl is 2, editable wants to set value for colum 3 tha
// is now column 1; n is 0, so set rel to 0 to update col 0 in
// the table instead of 2
rel=n;
break;
}
}
};
...
and the part of the table definition is:
<table id="example">
<thead>
<tr>
<th rel="2">Original Column 2</th>
...
Original comment by jens.lie...@googlemail.com
on 9 Aug 2012 at 9:31
Original issue reported on code.google.com by
thuyduon...@gmail.com
on 7 Mar 2012 at 11:03Attachments: