0

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?

1 Answer 1

1

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

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

1 Comment

Thanks Frnd...I gone with 2nd opt...!!

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.