This is a migrated thread and some comments may be shown as answers.

[Solved] Q2 2011 javascript problem binding grid to json object

0 Answers 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Charley
Top achievements
Rank 1
Charley asked on 20 Jul 2011, 01:26 PM
The below code is preQ2 2011 javascript that works perfectly.  If I include the new javascript in Q2 2011 this code breaks.  Please advise on what has change.  The problem is actually this line "grid.dataBind(json.WorkOrderRepairLines);" .  Thanks for any replies.



<script type="text/javascript">
    var grid = null;
    function onDataBinding(result)
    {
        grid = $(this).data('tGrid');
    }
  
    var currentInvoice;
    function UpdateWorkOrder(id)
    {
        $.ajax({
            url: 'http://imrsrs/workorderservice/' + id + '',
            data: {},
            type: "GET",
            success: function (data) {
                //alert(data.Company.CompanyName);
            },
            dataType: "jsonp",
            jsonpCallback: "localJsonpCallback"
        });
    }
  
    function localJsonpCallback(json)
    {
        currentInvoice = json;
        grid.dataBind(json.WorkOrderRepairLines);
    }
  
</script>
Tags
Grid
Asked by
Charley
Top achievements
Rank 1
Share this question
or