Skip to content

Create custom field select and ng-selected #60

Description

@openmotion

hello
i want to create a custom select element
i have my data like this :
"list": [
{
"id": "lhEMz6vl",
"name": "Qualit\u00e9"
},
{
"id": "EFJzlnk8",
"name": "Hygi\u00e8ne & Sant\u00e9"
},
]
i want my data appear in the exact position as in the original dataset

this is my directive, but the ng-selected do not work


TetxDirective.config(['$autofieldsProvider', function($autofieldsProvider){
	// Checkbox Field Handler
	$autofieldsProvider.registerHandler('select_adv', function(directive, field, index){
		
		 
		console.log(field);
		
		var current_value = field.value;
		console.log("current_value " + current_value);
		console.log("list "  );
	 
		
		var fieldElements = $autofieldsProvider.field(directive, field, '<select id="{{field.name}}" name="{{field.name}}" ng-model="list[0][\'foldertool_data\'][\'list\'][0] "   ng-options="option as option.name for option in list[0][\'foldertool_data\'][\'list\']  " >  </select>' );
 
		return fieldElements.fieldContainer;
	});
}]);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions