make read only column
make read only column
Hi All - I am new to the datatables, I am trying to make a read only columns and per the one of the thread i made "sClass: readonly" but, still not working.... any help is greatly appreciated.
"aoColumnDefs": [
{ "sClass": "readonly", "aTargets": [1] }
] --- but the column still editable... I don't know where I am going wrong...
this is my full code:
$(document).ready(function() {
/* Init DataTables */
oTable = $('#myDataTable').dataTable({
"bServerSide": true,
"sAjaxSource": "processor?action=select&table=acctrollups",
"bProcessing": true,
"sPaginationType": "full_numbers",
"bJQueryUI": true
}).makeEditable({
sUpdateURL: "processor?action=update&table=acctrollups",
sUpdateHttpMethod: "POST",
sAddURL: "processor?action=new&table=acctrollups",
sAddHttpMethod: "POST",
sDeleteHttpMethod: "POST",
sDeleteURL: "processor?action=delete&table=acctrollups",
"aoColumns": [ {
},
{
cssclass: "required",
indicator: 'Saving...',
tooltip: 'Click to edit',
onblur: 'submit',
},
{
cssclass: "required",
indicator: 'Saving...',
tooltip: 'Click to edit',
onblur: 'submit',
}],
"aoColumnDefs": [
{ "sClass": "readonly", "aTargets": [0] }
],
"aaSorting": [ [0,'desc'], [1,'asc'] ],
sAddNewRowFormId: "formAddNewRow",
oAddNewRowButtonOptions: { label: "+ Add", icons: {primary:'ui-icon-plus'}},
oDeleteRowButtonOptions: { label: "X Remove", icons: {primary:'ui-icon-trash'}},
oAddNewRowFormOptions: {
title: 'Add New Parent Child Account Mappings',
show: "blind",
hide: "explode",
modal: true} ,
sAddDeleteToolbarSelector: ".dataTables_length"});
//oTable.fnSetColumnVis( 0, false );
} );
"aoColumnDefs": [
{ "sClass": "readonly", "aTargets": [1] }
] --- but the column still editable... I don't know where I am going wrong...
this is my full code:
$(document).ready(function() {
/* Init DataTables */
oTable = $('#myDataTable').dataTable({
"bServerSide": true,
"sAjaxSource": "processor?action=select&table=acctrollups",
"bProcessing": true,
"sPaginationType": "full_numbers",
"bJQueryUI": true
}).makeEditable({
sUpdateURL: "processor?action=update&table=acctrollups",
sUpdateHttpMethod: "POST",
sAddURL: "processor?action=new&table=acctrollups",
sAddHttpMethod: "POST",
sDeleteHttpMethod: "POST",
sDeleteURL: "processor?action=delete&table=acctrollups",
"aoColumns": [ {
},
{
cssclass: "required",
indicator: 'Saving...',
tooltip: 'Click to edit',
onblur: 'submit',
},
{
cssclass: "required",
indicator: 'Saving...',
tooltip: 'Click to edit',
onblur: 'submit',
}],
"aoColumnDefs": [
{ "sClass": "readonly", "aTargets": [0] }
],
"aaSorting": [ [0,'desc'], [1,'asc'] ],
sAddNewRowFormId: "formAddNewRow",
oAddNewRowButtonOptions: { label: "+ Add", icons: {primary:'ui-icon-plus'}},
oDeleteRowButtonOptions: { label: "X Remove", icons: {primary:'ui-icon-trash'}},
oAddNewRowFormOptions: {
title: 'Add New Parent Child Account Mappings',
show: "blind",
hide: "explode",
modal: true} ,
sAddDeleteToolbarSelector: ".dataTables_length"});
//oTable.fnSetColumnVis( 0, false );
} );
This discussion has been closed.
Replies
[code]
.makeEditable({
sUpdateURL: "processor?action=update&table=acctrollups",
sUpdateHttpMethod: "POST",
sAddURL: "processor?action=new&table=acctrollups",
sAddHttpMethod: "POST",
sDeleteHttpMethod: "POST",
sDeleteURL: "processor?action=delete&table=acctrollups",
"aoColumns": [
null, /// THIS COLUMN IS NOT EDITABLE
{
cssclass: "required",
indicator: 'Saving...',
tooltip: 'Click to edit',
onblur: 'submit',
},
{
cssclass: "required",
indicator: 'Saving...',
tooltip: 'Click to edit',
onblur: 'submit',
}],
"aaSorting": [ [0,'desc'], [1,'asc'] ],
sAddNewRowFormId: "formAddNewRow",
oAddNewRowButtonOptions: { label: "+ Add", icons: {primary:'ui-icon-plus'}},
oDeleteRowButtonOptions: { label: "X Remove", icons: {primary:'ui-icon-trash'}},
oAddNewRowFormOptions: {
title: 'Add New Parent Child Account Mappings',
show: "blind",
hide: "explode",
modal: true} ,
sAddDeleteToolbarSelector: ".dataTables_length"});
} );
[/code]
thanks a lot.