webix.ui.select prototype

Hello i am triying to create a prototype for a select,
that loads a json data from a method
this to help our developer do the coding faster,
but i am getting a persistance :
Uncaught TypeError: Cannot read property ‘length’ of undefined

My Code is something like this

webix.protoUI({
	$cssName:"select",
	name:"closecodeselect",
	options:getCloseCodes()
},webix.ui.select);

where the method returns a array of json objects with the fields id and value.
i need urgent help with this

Hi,

You can provide the common default options in the $init handler:

$init:function(config){
  	config.options = getCloseCodes(); 
}

Please, check the following snippet: http://webix.com/snippet/34482a74

thank you