aulariosergio / jquery-datatables-editable

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

why does the demo page have a read only cell, but I can edit it? #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  Go to demo page. 
(http://jquery-datatables-editable.googlecode.com/svn/trunk/index.html)
2.  Double click the cell with the text "A Trident(read only cell)" 
3.  The text changes to an edit box, and I can change the value.

>expected output? 
The cell should not be editable.
>What do you see instead?
The cell is editable.

>What version of the product are you using? On what operating system?
Chrome Browser (same is seen with IE 9)

Original issue reported on code.google.com by jeffrey....@gmail.com on 15 Aug 2011 at 8:21

GoogleCodeExporter commented 9 years ago
it appears that if you define aoColumns for the table, then the read_only 
property is never checked.

jquery.dataTables.editable.js
Line: 218
Ver: 1.3.2

if (properties.aoColumns != null) {
    <SNIP>
} else {
    cells = $('td:not(.' + properties.sReadOnlyCellClass + ')', aoNodes);
    cells.editable(properties.sUpdateURL, oDefaultEditableSettings);
}

Original comment by jeffrey....@gmail.com on 16 Aug 2011 at 6:50

GoogleCodeExporter commented 9 years ago
Hmmm, 

Its also effect the jEditiable code as well, since if you have a aoColumns 
definition in the editable() method, then the read_only will also be ignored. 
But jEditiable does not seem to support the use of aoColumnDefs.

So I'm stuck with the choice of some making cols editable, but then not being 
able to define droplist as the edit choice in others, or making them all 
editable and having drop lists. I can't make some NOT editable and some have 
droplists.

for example...

$('#example').dataTable({ 
    "aoColumnDefs": [
        { "bVisible": false, "aTargets": [ 1 ] }
        ],
    }).makeEditable({
    "aoColumns": [
        { },
        { },
        { },
        { type: 'select',
          onblur: 'submit',
          data: "{'M':'M','Y':'Y'}",  
          aTargets: [ 4 ]}
        ],
});

Original comment by jeffrey....@gmail.com on 16 Aug 2011 at 7:20

GoogleCodeExporter commented 9 years ago
Same problem here :-(

Original comment by bigande...@gmail.com on 27 Aug 2011 at 6:58

GoogleCodeExporter commented 9 years ago
You are right. This is fixed in the latest version of the code 1.3.2. 
See online example in the index page.

Regards,
Jovan

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

GoogleCodeExporter commented 9 years ago
What do you mean: "the latest version of the code 1.3.2"? The latest version is 
1.3!

Original comment by Anton.Ch...@gmail.com on 24 Feb 2012 at 10:13