Page 2 of 3

Select Component

Posted: Wed Nov 09, 2016 6:01 pm
by leven.steve

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


Select Component

Posted: Wed Nov 09, 2016 6:06 pm
by leven.steve

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


Select Component

Posted: Thu Nov 10, 2016 7:24 am
by Zhivko Zhelev

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...


Select Component

Posted: Thu Nov 10, 2016 7:54 am
by leven.steve

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


Select Component

Posted: Thu Nov 10, 2016 7:58 am
by Zhivko Zhelev

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


Select Component

Posted: Thu Nov 10, 2016 7:59 am
by leven.steve

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.


Select Component

Posted: Thu Nov 10, 2016 8:08 am
by Zhivko Zhelev

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


Select Component

Posted: Thu Nov 10, 2016 8:47 am
by leven.steve

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


Select Component

Posted: Mon Nov 14, 2016 9:39 am
by Serhii Kulibaba

Hello Zhivko,

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


Select Component

Posted: Wed Nov 16, 2016 8:12 am
by Zhivko Zhelev

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