settings variable names

settings variable names

wpswps Posts: 15Questions: 0Answers: 0
edited November 2009 in General
What is the difference between settings variables (such as oSettings.iDisplayStart and oSettings._iDisplayStart) sometimes referred to/addressed with the underscore and other times not? Two ways to address the same variable or two different things?

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Hi wps,

    I use the underscore to denote "private" properties, which should only really be used internally by DataTables (since Javascript doesn't have a "private" variable option). With these properties, you should generally use a method which is provided in order to get or set their value, such as oSettings.fnRecordsTotal().

    It's worth noting that _iDisplayStart is an exception to this rule... You can safely use this property (at the moment!), but I think I might add a get/set method for it in the future. Also there is no oSettings.iDisplayStart property, only oSettings._iDisplayStart.

    Regards,
    Allan
This discussion has been closed.