I am trying to write a simple jquery plugin with some php code to display tables from a database. The plugin allows the user to search, browse and sort pages. I know that there are wonderful plugins for this, but I'm new (6 months with any programming) and I'm trying to find out something.
Almost everything has been done, but I stopped when trying to make "multi-level" options.
The easiest option for the user looks like this (almost all of them look like this):
$('#main').ableTable({
mode :'sqlite'
})
Then it overrides the default settings:
var settings = $.extend({
mode : 'mysql'
} ,options);
It's simple.
But if I have a more complex option, for example:
var settings = $.extend({
translate :{
navigation :{
prev :'previous' ,
next :'next'
} ,
search :'search' ,
no_result :'nothing was found' ,
from :'from' ,
total :'total'
}
// other options
} ,options);
Then, if the user only declares:
$('#main').ableTable({
translate :{
navigation :{
prev :'poprzedni'
}
}
})
It overwrites everything in settings.translate
, settings.navigation.prev( ) ?