Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create custom field select and ng-selected #60

Open
openmotion opened this issue Mar 7, 2017 · 1 comment
Open

Create custom field select and ng-selected #60

openmotion opened this issue Mar 7, 2017 · 1 comment

Comments

@openmotion
Copy link

openmotion commented Mar 7, 2017

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;
	});
}]);
@JustMaier
Copy link
Owner

Hey @openmotion I'm not sure I understand what you're trying to do. Can you show me with just normal HTML or something?

If I am understanding correctly I think you are using a special handler when you don't really need one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants