Tony,
Good call on the [CDATA] tags – I did some research for a PHP/JSON equivalent and the awnser, it seems, is PHP 5.3 and NOWDOC.
$complete_function = <<<'EOT'
function() { dosomething(); }
EOT;
$export->grid->gridComplete = $complete_function;
Unfortunatley no 5.3 is still in Beta and not suitable for my production server. So I have a grid workaround.
I edited grid.import.js and made your $.ajax() call non async – this way I can then use .setGridWidth to correct the grid dimensions.