Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am implementing http://ui-grid.info/ in my application.

I am populating the grid with ajax call like this :-

$scope.getGrid = function () {
     jq.ajax({
                type: "POST",
                url: "getData",
                dataType: "html",
                traditional: true,            
                data: { columnDb: $scope.columnDb },
                success: function (data) {
        var dataObj = jQuery.parseJSON(data);
        ......
        $scope.gridOptions.data = $scope.myData;  
     });        
}

There is a weird problem i am facing. on the above function call, i can see nothing in my HTML, But if i just mouse scroll on the Grid area the data gets displayed, even if i open Inspect Element in Chrome, the data gets displayed.

Any Idea How to solve this?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

This code does not lead to an Angular digest when the ajax call returns, and hence you don't see anything change in your on screen 'view'. So you can either:

  1. Use $http for your ajax call
  2. Add a $scope.$apply() to the callback function.

I would suggest using 1

share|improve this answer
1  
Thanks Frnd...I gone with 2nd opt...!! –  Anup Nov 1 '14 at 10:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.