I have a module, which renders an AJAX form, which passes data to a script via drupal_add_js
and stores it in the settings property of the Drupal object. My problem is that I cannot seem to remove old data from the object (a user can toggle options on the form and send new datasets to the javascript). Logically, I thought passing an empty array would clear the values, but it doesn't.
// Clear old data from settings.
$js = array(
'd3' => array(
'inventory' => array(
'chart' => array(
'dataset' => array(),
),
),
),
);
drupal_add_js($js, 'setting');
I need something like drupal_remove_js($js, 'setting')
? or a method for removing object properties?