views:

26

answers:

2
var tinymce_toolbar = {}
tinymce_toolbar.__default =
{
   script_url: '/cms/libs/js/manual/renders/tiny_mce/tiny_mce.js',  
};
tinymce_toolbar.__simple =
{
   script_url: '/cms/libs/js/manual/renders/tiny_mce/tiny_mce_simple.js',   
};


// Doesn't work
var t = $(this).find('input[name=toolbar]').first().val();
$('.RenderHtmlEditor').tinymce(tinymce_toolbar.t);

// works
var t = $(document).find('input[name=toolbar]').first().val();
$('.RenderHtmlEditor').tinymce(tinymce_toolbar.__default);
$('.RenderHtmlEditor').tinymce(tinymce_toolbar.__simple);

how i do it to be dynamic? Thanks

+2  A: 

object['name'] is quite same way as object.name. simply assign a associative attribute and use it as a property.

Tomasz Kowalczyk
if you are satisfied, please accept ;]
Tomasz Kowalczyk
+1  A: 

Instead of dot notation,

tinymce_toolbar.t

Use subscript notation:

tinymce_toolbar[t]
Andy E