how can i define the plugin default settings value.. a calculated object or ajax call..

how can i define the plugin default settings value.. a calculated object or ajax call..

on jquery 1.8.3

hello
this is my first plugin..
how can i define the plugin default settings value.. a calculated object or ajax call..
that cade just not working..
the function on the setting data - not working...

  1. (function ($) {
  2.     $.fn.treeview = function (options) {

  3.         // plug default virtuals
  4.         var settings = $.extend({            
  5.             data: (function () {
  6.                 this.data = "i am DATA from pluging default setings";
  7.                 //return "i am DATA from pluging default setings";
  8.             }),
  9.             rootName: "none",
  10.             isExpandAll: false,
  11.             isLoadCss: true,
  12.             containerID: null

  13.         }, options)


  14.         function loadTree(callback) {

  15.             if (!settings.data) { alert("treeview plugin data:null"); return; }
  16.             alert(settings.data);
  17.             
  18.             if (callback) callback();
  19.         }        
  20.     }
  21. }(jQuery));

and calling for that plug


  1.             $.getScript("../../../resource/js/lib/treeview/treeview.Plugin.js", function () {
  2.                 $.fn.treeview({
  3.                     //data: {},
  4.                     isExpandAll: false,
  5.                     containerID: "xxx"
  6.                 });
  7.             }).success(function (e) {
  8.                 //alert(1);
  9.             }).fail(function (e) { alert(2); });