You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently developing an application that have a lot of entities associations where both sides of the relationship have a large number of items. Because of this, I'm using remote dropdowns to show these entities. Specifically I'm using Select2.
I would love to remove the Select2 dependency and use the dropdown component for everything, but it still don't have some of the features that I need. I think these features would be nice improvements to the component:
Different templates/visualizations for the item
In some scenarios, it may be useful to have one template for when the item is displayed in the open dropdown and another for when it is selected and the dropdown is closed:
This can be partially achieved by customizing the dropdown templates, but since the label template don't have access to the received json data it is almost impossible to make it work for the closed dropdown.
Retrieve the selected item data
Sometimes, the loaded data has much more information than what is displayed by the dropdown. The data used by the last example is something like this:
It would be very useful to be able to retrieve the json object for the selected item. I'm thinking of something like:
varselected_item=$('.dropdown').dropdown('selected item');console.log(selected_item.cidade);// Would log "BOM JESUS"
I did some tests locally and I don't think it would be hard to implement this. If you agree that these are features worth implementing, I could make a PR
The text was updated successfully, but these errors were encountered:
I'm currently developing an application that have a lot of entities associations where both sides of the relationship have a large number of items. Because of this, I'm using remote dropdowns to show these entities. Specifically I'm using Select2.
I would love to remove the Select2 dependency and use the dropdown component for everything, but it still don't have some of the features that I need. I think these features would be nice improvements to the component:
Different templates/visualizations for the item
In some scenarios, it may be useful to have one template for when the item is displayed in the open dropdown and another for when it is selected and the dropdown is closed:
This can be partially achieved by customizing the dropdown templates, but since the label template don't have access to the received json data it is almost impossible to make it work for the closed dropdown.
Retrieve the selected item data
Sometimes, the loaded data has much more information than what is displayed by the dropdown. The data used by the last example is something like this:
It would be very useful to be able to retrieve the json object for the selected item. I'm thinking of something like:
I did some tests locally and I don't think it would be hard to implement this. If you agree that these are features worth implementing, I could make a PR
The text was updated successfully, but these errors were encountered: