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
ui-grid 3.0 and editDropdownOptionsArray with $http #2050
Comments
It is, but not via an interim variable. This is a pointer thing - you're making editDropdownOptionsArray a pointer to $scope.countries when $scope.countries is empty - so it's a pointer to an empty array. Then later you replace the $scope.countries pointer with a pointer to a new array, but the editDropDownOptionsArray isn't updated. If you instead did:
it would probably work. |
It worked! Thanks! |
Shouldn't the correct functionality of editDropdownOptionsArray be expected to be a pointer? Order of the columns can change. |
It should be expected to be a pointer. But the problem in this example was outside ui-grid: var A = [1, 2, 3]; Irrespective of ui-grid, B is still pointing to [1, 2, 3]. In the example above @xavadu never set the dropdown options into a variable that ui-grid could see, equivalent to giving ui-grid B and expecting us to somehow now that A has changed. |
@PaulL1 It worked! But is there any other way of not using " $scope.gridOptions.columnDefs[0]" since the colDefs may change regularly. |
I have this working, instead of assigning a new array instance, just loop through your data returned and .push it into the existing array and all will be well.
|
@tseanf Could you show demo with your solution, please? At plnkr or real site. |
@alexey-vasyunin I think this would be for the same example;
|
Hello,
It isn't possible to assign editDropdownOptionsArray to a columDefs loading it async with $http?
PoC:
or any solution to accomplish it?
Thanks
The text was updated successfully, but these errors were encountered: