-
Notifications
You must be signed in to change notification settings - Fork 80
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
$scope.selectedItem undefined when selector inside tab #1831
Comments
This is an issue with using dynamic items selector with a tab/tabaset as well. In this example: <uib-tabset class="nav-tabs-wrapper">
<uib-tab heading="Advertistements">
<div class="form-group">
<label>Select Advertistements</label>
<div class="label-content">
<sf-list-selector sf-dynamic-items-selector
sf-multiselect="true"
sf-master="true"
sf-selected-ids="selectedAdvertisementIds"
sf-item-type="properties.AdvertisementType.PropertyValue"
sf-identifier-field="Title">
</sf-list-selector>
</div>
</div>
</uib-tab>
</uib-tabset> selectedAdvertisementIds is not set by the directive. if you remove the tab/tabset, it will works as expected. As a workaround in the associated angular controller: $scope.itemSelector = { selectedItemsIds: [] };
$scope.$watch(
"itemSelector.selectedAdvertisementIds",
function(newValue, oldValue) {
if (newValue !== oldValue) {
$scope.properties.SelectedAdvertisementIds.PropertyValue = JSON.stringify(newValue);
}
},
true
); |
I ran into this last week, and has reported it as a bug. It is confirmed as a bug by Telerik Support. |
This (sf-link-selector / link selector) is also broken inside of expanders. |
Refer to this article for a workaround https://knowledgebase.progress.com/articles/Article/Implementing-sf-link-selector-inside-an-expander-in-a-custom-MVC-widget-designer |
@NikolayBa I ran into this problem and was able to work around it with the proxy method described in your link. However it seems to have a race condition when I am trying to set an initial value for the selector. I added a watch to the scope.selectedItem and it will often reset the value back to the default empty one after setting it correctly initially when the propertyService.get() was called. Do you have any ideas why is this happening? |
I am trying to place a sf-link-selector within a tab.
It works when its not in a but as soon as i place it inside it, $scope.selectedItem is undefined.
It seems like it doesn't bind $scope.selectedItem on init when its inside the tab.
Any idea how i can make it work?
Also is it possible to have multiple selectors (if the same time) within one designer?
The text was updated successfully, but these errors were encountered: