Methods

Top  Previous  Next

addLinkedControl( control)

Adds a linked child DbNetFile instance to the control (typically used to display files for a selected folder). Linked controls should have their properties assigned before being passed as an argument to the addLinkedControl method. There is no need to call the initialize method for linked controls as this is done automatically.
Parameters

control

object

Reference to the child DbNetFile control.

Run Sample

addToolbarButton( index)

Adds a button to the toolbar.

Returns

A reference to the button
Parameters

index

number

The position in the toolbar where you would like the button added. If no index is supplied the button is added at then end of the toolbar.

bind(eventName, handler)

Binds a client-side function to an event
Parameters

eventName

string

Name of the event

handler

function

Reference to the client-side function

Run Sample

initialize()

Initializes the control and returns the first page of data. The method should be called after all the properties have been assigned.

Run Sample

setColumnLabels(columnLabels)

Specifies the labels for the columns specified in setColumnTypes
Parameters

columnLabels

array of strings

or

multiple strings

List of labels

 

setColumnProperty(columnName, propertyName, propertyValue)

Assigns a property value to the specified column (or columns)

Parameters

columnName

string|array of strings

Column name or array of column names

propertyName

string

Name of the column property

propertyValue

string, number or boolean

The property value

 

setColumnTypes(columnTypes)

Specifies the columns that are displayed in the file control. The column types that can be selected depend on the browseMode which controls the way in which the file system is accessed. For the default browseMode of FileSystem the following column types are available.

Column Type

Description

Icon

Icon representing the file type in the column

Name

File name

Size

File size

DateCreated

Date the file was created

Type

File type (extension)

DateLastModified

Date the file was last modified

DateLastAccessed

Date the file was last accessed

Thumbnail

Thumbnail (for image files only)

Folder

Parent folder

 

If you are using WindowsSearch as the browseMode then you can find a list of available column types available here

If you are using IndexingService as the browseMode then you can find a list of available column types available here

 
Parameters

columnTypes

array of strings

or

multiple strings

List of column types

 

	<script>
	jQuery(document).ready( init )

	function init()
	{
		var dbnetfile1 = new DbNetFile("dbnetfile1");
		with (dbnetfile1)
		{
			rootFolder="~/samples/dbnetfile/files"

			setColumnTypes("Icon","Name","Folder","DateCreated","Size","DateLastModified","DateLastAccessed","Thumbnail");

			setColumnProperty("Name","selectable",true);
			setColumnProperty("DateCreated","format","MMM yyyy");
			setColumnProperty("DateLastModified","label","Last Modified");
			setColumnProperty("DateLastAccessed","label","Last Accessed");
			setColumnProperty("DateLastModified","format","g");
			setColumnProperty("DateLastAccessed","format","dddd");
			setColumnProperty("Thumbnail","label","Thumb");

			initialize()
		}
	}

	</script>

Run Sample

toolbarElement(id)

Gets a reference to the specified toolbar element.

Parameters

id

string

id can be search, deleteRow, newFolder or upload