Simple DataStoreComponent Development Example

NEST.define("com.nxstinc.nest.component.data", {
ImageTable : function() {
	var clazz = function(id) {
		this.id = id;
		this.data = undefined;
		this.__dataColumns = ["path", "name", "size", "date", "text"];
	};
	
	clazz.prototype = NEST.inherits("com.nxstinc.nest.component.DataStoreComponent");

	clazz.prototype.paint = function(context) {		
	};
	
	clazz.prototype.take = function() {
	 // New data is created when this method is invoked, the data is transferred along with its associated event to a related component. 
		var d = this.data;			
		var p = {
			v : 1.0,
			a : 1,
			ts : (new Date()).getTime(),
			content : d,
		}; // NEST DataStore Protocol Object
		this.trigger("onTake", p);
	};

	// #ifdef designing
	clazz.prototype.editor = function() {
		var d = {
			palette : {
				category : "DataStore",
				alias : undefined,
				priority : 5,
				description : "ImageTable",
			},
			property : {
				data : {
					type : "StringTable",
					editor : "ImageTableEditor",
					category : "Data",
					priority : 1,					
				},
			},				
			event : {
			},
			method : {
				take : {
					priority : 1,
				},
			},
		};
		return d;
	};
	// #endif designing

	return clazz;
}
});