Skip to content

Index of tab in array/tabarray #607

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

Closed
tkitv opened this issue Nov 24, 2015 · 3 comments
Closed

Index of tab in array/tabarray #607

tkitv opened this issue Nov 24, 2015 · 3 comments

Comments

@tkitv
Copy link

tkitv commented Nov 24, 2015

Hi,

I need to set the values of other items of a tabarray in the success callback after backend validation. My form looks like this:

 {
      key: "Parkey",
      type: "tabarray",
      title: "{{$index }}",     //works     
      items: [
         "Parkey[].Number",
         "Parkey[].Name",
        {
           key: "Parkey[].BP",
           validationMessage: {
                    'bp': 'BP invalid'
                },
                $asyncValidators: {
                    bp: function (value) {
                        var deferred = $q.defer();
                        $timeout(function () {
                            viewModelHelper.apiGet('api/Dwh/ValidateBP?BP=' + value, null, function       (result) {                                
                              if (result.data.length > 0) {                                       
                                    $scope.model.Parkey[***NEED INDEX HERE****].Name= result.data[0].Name;
                                    $scope.model.Parkey[***NEED INDEX HERE****].Number= result.data[0].Number;                                        
                                    deferred.resolve();
                                }
                                else deferred.reject();
                            });                               
                        }, 500);
                        return deferred.promise;
                    }
                }
            }     
    ]

So how can I get that index?

br

@nicklasb
Copy link
Member

Could you please explain further?

@Anthropic
Copy link
Member

@tkitv keep an eye on this PR it will allow you to find the value you are looking for when we are ready to merge it:
#652

I'll close this issue for now.

@raquintero
Copy link

@Anthropic Has this exact issue been fixed somewhere? I need an index value to pass along in an onChange event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants