leven.steve
Posts: 0
Joined: Sun Mar 04, 2012 4:01 pm

Select Component

I think I may have spotted your problem. Been there and got the t-shirt myself.
Ignore the "option" component. This is added by Appery and used if you want to hard code options. Put your model info and options on the "select" component instead.

Look at the breadcrumb in your attached image select2.png and you are setting the "ng-" attributes on selectoption4 under options3 under select3.

Change that so that (a) you only have one "option" component on the "select" and (b) the "ng-" entries are on select3 instead and then it will work.

See my images for an example.
Image

leven.steve
Posts: 0
Joined: Sun Mar 04, 2012 4:01 pm

Select Component

And then using the code I posted earlier where I setup the first array item as "Select Employee Name", when I set for a new entry $scope.selectedEmployee=$scope.employeelist[0]
I get the correct option displayed.

Likewise if I am editing an entry and I know the Employee Name from the database query I can find it in the employeelist array and set $scope.selectedEmployee=$scope.employeelist
where i is the loop counter (see earlier code post)
Image

Zhivko Zhelev
Posts: 0
Joined: Tue May 31, 2016 6:59 am

Select Component

Yes, I notice this difference in the breadcrumb in your first screenshot. But I cannot change that... if I try appery.io deletes the all select component... and I cannot understand why is that. And of course there is absolutely no documentation.... as always... really disappointed
Thank you very much for the help. I got your point... will think what to do...

leven.steve
Posts: 0
Joined: Sun Mar 04, 2012 4:01 pm

Select Component

You should be able to remove any extra options using the cog icon on the option.
In any event just put your ng- attributes on the select and not on the option

Zhivko Zhelev
Posts: 0
Joined: Tue May 31, 2016 6:59 am

Select Component

I notice something strange: when I open the select there is the one empty row. I choose one of the items then open the select component again and there is no empty row..... wtf....
Image

leven.steve
Posts: 0
Joined: Sun Mar 04, 2012 4:01 pm

Select Component

Actually you can leave the extra options there. I just tried it by adding two more to my select and they don't show up. But to delete the options you dont need, on the select component set the Opened attribute to True to show them all and then use the cog icon on the Option to delete it until you have one left.
But as I said, you can ignore them.

Zhivko Zhelev
Posts: 0
Joined: Tue May 31, 2016 6:59 am

Select Component

Yes, I deleted them from the beginning. It's only one element.
And then I move the ng-options to the select component (Select3) it comes with error, so this is not the solution.

Image

leven.steve
Posts: 0
Joined: Sun Mar 04, 2012 4:01 pm

Select Component

I'm not sure I can diagnose the compile error.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Select Component

Hello Zhivko,

Please clarify, what property ng-options do you use here?

Zhivko Zhelev
Posts: 0
Joined: Tue May 31, 2016 6:59 am

Select Component

Hi,
About this compile error, no probs. I got what why is that. The problem is still only in the empty first row. This is the options component.
Image

Return to “Issues”