I’ve never really run into this in the past, so I’m curious. Can you do the following in some manner?
I am using the Datatables jQuery plug-in. Here’s my basic call:
var oTable = $("#example").dataTable();
I have a property in a class called EnableInlineEdit. If it is true, I want to add a function call inline:
var oTable = $("#example").dataTable().makeEditable();
This would enable the jEditable plug-in to work. I have a lot more options added to the Datatable plug-in regularly that I haven’t included, so simply making a conditional if/else and creating two separate calls in out of the question. I would be doubling the size of a massive file by doing that. Is there a way to somehow create an inline conditional to add the .makeEditable onto the end of the Datatable initialization without creating two exact copies of the code with one just having the .makeEditable() on it?
Can’t you just do something like this: