Quantcast
Viewing all articles
Browse latest Browse all 82130

Need for editable's aoColumns number to change dynamically

My problem is that when the initial datatable loads there are 8 columns, one of which contains links to another page that reuses that same datatable. Only when the link is clicked one of the columns from the table is removed, therefore moving all of my editable properties over by one cell (to make up for the now missing column.

Here is a sample of my code:
$(selector).dataTable().makeEditable({
sUpdateURL: url,
"aoColumns": [
null,
null,
null,
null,
{
event: 'click',
onblur: function(value, settings) {
this.reset(value);
$(this).html(value);
App.startEvents(selector);
return value;
},
callback: function(value, settings) {
if($(this).html().indexOf("<") === -1) {
App.startEvents(selector);
}
},
data: function(value, settings) {
App.stopEvents($(this));
return App.fieldData(value);
},
onreset: function(value, settings) {
App.startEvents(selector);

},
oValidationOptions : {
rules: {
value: {
required: true,
date: true
}
}
}
},
null
]
});

Basically I want to be able to remove one of the null's when the number of columns for the table changes.
Something like if (numOfColumns == 8) leave the null there else remove the null.

This code is trimmed from my original, but should hopefully give you an idea of my situation.
Thanks in advance for any help.

Jake

Viewing all articles
Browse latest Browse all 82130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>