0

this is the JSON object i got from two table joining..

[{"a.opp_name" : "fff",
  "b.client_name" : "Burlington Pension",
  "a.opp_value" : "2.0",
  "a.opp_target_date" : "2014-08-08",
  "d.parameter_name" : "WON",
  "a.opp_rm" : "Lisa Hayden",
  "a.opp_probability" : "43",
  "c.parameter_name" : "Fixed Income",
  "a.opp_next_step" : ""}]

and this is the Javascript file.

$scope.gridOptions = {      
        data : 'Values',
        selectedItems: $scope.mySelections,
        multiSelect: false,
        columnDefs: [
          {field:'opp_key', displayName:'Opportunity Key',visible:false},
          {field:'opp_name', displayName:'Name', cellTemplate: '<div>{{a.opp_name[0]}}</div>'},
          {field:'b.client_name', displayName:'Client' },
          {field:'a.opp_value', displayName:'Target Amount' },
     // ,  cellTemplate:'<div>${{row.entity.opp_probability}}M <div>'    | date : MM-dd-yy
          {field:'a.opp_target_date', displayName:'Target Date'},
          {field: 'd.parameter_name',displayName:'Stage'},
          {field:'a.opp_rm', displayName:'Owner'},
          {field:'a.opp_probability', displayName:'Probability', },
          // cellTemplate:'<div><progress id="progressBar" data-ng-model="row.entity.opp_probability" data-ng-value="row.entity.opp_probability=convert(row.entity.opp_probability)" max="100" style="width: 50px;"></progress>&nbsp; {{row.entity.opp_probability}}%</div>'
          {field:'c.parameter_name', displayName:'Mandate'}, 
          {field:'a.opp_next_step', displayName:'Next Step'}]
};

From here we didn't get the values in ng-grid..

1
  • Are you seeing any error on your browser console? Is your JSON object being assigned to $scope.Values? Also, there is an additional opp_key field in your columnDefs. Commented Aug 11, 2014 at 5:55

1 Answer 1

-1

For this issue we use the Surrogate names for the same keyname..here parameter name coming two times.so we can use the surrogate name for differentiating the two parameter names.

Like this..

ColumnNames ="opp_key,opp_name,client_name,opp_value,opp_target_date,parameter_name,opp_rm,opp_probability,parameter_name,opp_next_step,user_first_name";

SurrogateNames ="opp_key,opp_name,client_name,opp_value,opp_target_date,stage,opp_rm,opp_probability,mandate,opp_next_step,user_first_name";

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.