Dashboard plugin - add new widget error

Dashboard plugin - add new widget error

Hi there,

Has anyone successfully got this plugin working well with saving the current dashboard state on the server side?

I added/set the 'stateChangeUrl' option, which works fine when moving the default widgets around. But when I click to add a new widget, I get the following error in my firebug console:

  1. dashboard.getWidget($(this).attr("id")) is null
  2. r+= (dashboard.getWidget($(this).attr("id"))).serialize();

I've pretty much got the dashboard set up as per the examples, with this code here for adding a widget:



  1. // binding for a widgets is added to the dashboard
  2.           dashboard.element.live('dashboardAddWidget',function(e, obj){
  3.             var widget = obj.widget;
  4.             dashboard.addWidget({
  5.               "id":startId++,
  6.               "title":widget.title,
  7.               "url":widget.url,
  8.               "metadata":widget.metadata
  9.               }, dashboard.element.find('.column:first'));
  10.           });

I even tried changing the widget id to
"id":widget.id, but didn't work.

Any ideas?