Custom Instance Settings

Custom Instance Settings

MichaelScottMichaelScott Posts: 2Questions: 0Answers: 0
edited March 2010 in Plug-ins
Hi,

I really like DataTables - very well thought out and presented.

Just a small query:
I am trying to put together a DOM Feature/plugin to do date range filtering - I have been looking at the examples. I would like to be able to pass in an instance specific custom setting (sIQXdateRangeDivID in the example) which will find its way to the fnInit oSettings argument when the feature is initialized. I have added my setting to the dataTables initialization object:
[code]
var dt=$('#tblFtimesheets').dataTable({
"sPaginationType": "full_numbers",
"sDom": 'lDf<"clear">rtip',
"aaSorting": [ [0,'desc'], [1,'desc'] ],
"aoColumns": [{},{},{},{},{},{},{bSortable:false,bSearchable:false},{bVisible:false}],
"sIQXdateRangeDivID": "tblDateRange"
});
[/code]
- but no sign of it in the oSettings, so presumably this isn't allowed? Do you have a suggested method for this sort of thing?

Best regards,

Michael

Replies

  • allanallan Posts: 55,815Questions: 1Answers: 8,815 Site admin
    Hi Michael,

    Very interesting - possibly something you can share when completed? :-)

    You are quite correct - that this is something that DataTables is lacking in at the moment. What it does is simply ignore initialisation properties that are unknown to it. One option in future is to assign them to a oSettings property with 1:1 mapping, or a sub object or something. Certainly something which needs to be looked at!

    What I did with TableTools to counter this is use a global variable called "TableToolsInit" which TableTools can look at (and it clones in fact) when it is initialised. So I think if you just have a variable called "sIQXdateRangeDivID" and reference that - that will do the trick.

    A future modification will make this much smoother...

    Regards,
    Allan
  • MichaelScottMichaelScott Posts: 2Questions: 0Answers: 0
    Hi Allan,

    Thanks for the reply. Yes perhaps a 'custom' sub-object in the initialisation props which was passsed through would be nice. I'll have a play with the global approach meantime.

    Regards,

    Michael
This discussion has been closed.