nJDSK.Window.toolbarHelper.addItem


Adds a toolbar button in given row.

nJDSK.Window.toolbarHelper.addItem(row, id, title, image, callback)

Parameters

string row row id, if left empty, item will be added in the default row (row_1)

string id button id, required

string title button title

string image button icon url

function callback function called on button click

Example

var newWindow = new nJDSK.Window(640,480,'A window with text and toolbar','',msg, nJDSK.uniqid());
// add toolbar items (params: toolbar row(Yes, you cn use multiple rows), id, title, icon, click function)
// This is a built-in helper plugin
	newWindow.toolbarHelper.addItem(
		'row1',
		'UpDir',
		'UpDir',
		'images/icons/silk/arrow_up.png',
		function(sender)
		{
			alert('You clicked this tool button '+sender.attr('title'));
		}
		
	);
	newWindow.toolbarHelper.addItem(
		'row1',
		'Refresh',
		'Refresh',
		'images/icons/silk/arrow_refresh.png',
		function(sender)
		{
			// do nothing now, empty callbacks can be omitted	
		}
							
	);
	// separator
	newWindow.toolbarHelper.addItem(
		'row1',
		'',
		'separator'
	);