angular-ui/ui-grid

UI grid while row rendering for each row making service call

Open

#5,336 opened on Apr 20, 2016

View on GitHub
 (0 comments) (0 reactions) (0 assignees)JavaScript (5,395 stars) (2,496 forks)batch import
help wantedseverity: performance

Description

Hi Friend , I am new to the UI grid and Angularjs . Me facing one issue in ui-grid row rendering.

From the service getting JSON response data . JSON having array of 10 objects. After getting the response set to the $scope.gridOption.data = response data.

in bebugging mode if you check console its rendering 100 time response ; it means my grid having 10 columns and My json having 10 object (10x10). I am not sure how to solve this . Please do the needful . Pleasse find the below screen shot .

Service call : image

Service layer : image

Console :

![image](https://cloud.githubusercontent.com/assets/9865404/14672115/6a79c00e-0713-11e6-90df- aee739ab570f.png)

JSON :

{ "name": "Rain X", "customer": "customer2", "owner": "Larry Zeiss", "location": "Portland", "event_photo": "photoURL", "status": 2, "retailer":"Kroger - Atlanta", "store":"255", "city":"Westchester", "pod":"1234", "eventprograms":"FasWax", "eventid" :"112", "nomessages" :[ { "islive":false, "messages":5 } ], "hosts": [ { "id": "userid", "place": "placeId"

  }
],
"schedules": [
  {
    "start_time":"",
    "end_time": "3:30pm"
  }
],
"photos": [
  {
    "photo": "../../../images/flower.png",
    "instructions": "",
    "status": 3,
    "time":"13:30pm",
    "status_message" :"Event complete",
    "id":5
  },
  {
    "photo": "../../../images/Koala.jpg",
    "instructions": "",
    "status": 3,
    "time":"13:30pm",
    "status_message" :"Event complete",
    "id":1
  },
  {
    "photo": "../../../images/Tulips.jpg",
    "instructions": "",
    "status": 3,
    "time":"13:30pm",
    "status_message" :"Event complete",
    "id":2
  },
  {
    "photo": "../../../images/flower.png",
    "instructions": "",
    "status": 3,
    "time":"13:30pm",
    "status_message" :"6 Photos Approved",
    "id":3
  },
  {
    "photo": "../../../images/flower.png",
    "instructions": "",
    "status": 3,
    "time":"13:30pm",
    "status_message" :"Event complete",
    "id":4
  },
  {
    "photo": "../../../images/flower.png",
    "instructions": "",
    "status": 3,
    "time":"13:30pm",
    "status_message" :"Event complete",
    "id":0
  }

] 

}

Thanks Praveen.B

Contributor guide