NasExt / DependentSelectBox

DependentSelectBox control for Nette Framework
MIT License
22 stars 26 forks source link

AJAX request fired multiple times #28

Closed rozsival closed 6 years ago

rozsival commented 6 years ago

Today, I implemented this neat library into my project. The implementation itself was very simple. However, one head-scratcher occurred. I have a form in which there are 3 dependent select boxes, each dependent on:

When I make a change to any of registered parents, the AJAX request gets fired as many times as the count of all select boxes that need to be changed due to a change of their respective parents. Every change made to the form therefor takes a ridiculous amount of time and slows down the development and testing.

Is this a standard behavior or should this extension be able to get all the data in single request?

aleswita commented 6 years ago

Hi, in dev speed is lazy (tracy reloaded request by request), its true. But in production mode its ok. I have forms with 5 dependent boxes and changes are instant.

rozsival commented 6 years ago

@aleswita Thanks for your reply. I have tried it in production mode as well and yes, it is much faster. Anyway, I would like to know if it's intended that there are separate AJAX requests for each select box. The client-side code looks like it is expected behavior, I just want to be sure I'm not doing anything wrong.

aleswita commented 6 years ago

Yes, its expected behavior.