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

get_masterTableView() is null

1 Answer 325 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Keith
Top achievements
Rank 1
Keith asked on 10 Dec 2014, 12:02 AM
I keep getting this error: "Cannot read property 'get_masterTableView' of null"  every time .
I bind the Pivot grid in my C# code behind file and it displays the data just fine in the PivotGrid.

Here is my ASP code:

<script type="text/javascript">

   <telerik:RadPivotGrid ID="RadPivotGrid1" runat="server" 
        ResolvedRenderMode="Classic"  OnCellCreated = "RadPivotGrid1_CellCreated" 
        OnCellDataBound = "RadPivotGrid1_CellDataBound" ViewStateMode="Enabled"    >
        
        <PagerStyle ChangePageSizeButtonToolTip="Change Page Size" PageSizeControlType="RadComboBox">
        </PagerStyle>
  


                  
        <Fields>
            
            <telerik:PivotGridRowField DataField="ANNEX_ID" UniqueName="column2">
            </telerik:PivotGridRowField>
            
            <telerik:PivotGridRowField DataField="CLIN_ID" UniqueName="column1">
            </telerik:PivotGridRowField>
            
            <telerik:PivotGridColumnField DataField="FY_CODE" UniqueName="column">
            </telerik:PivotGridColumnField>
            
            <telerik:PivotGridColumnField DataField="MOD" UniqueName="column4" 
                SortOrder="Descending">
            </telerik:PivotGridColumnField>
            <telerik:PivotGridAggregateField  
                DataField="FUNDING_AMOUNT" GrandTotalAggregateFormatString="" DataFormatString="{0:c}" 
                UniqueName="column5" CalculationExpression="" ZoneIndex="3">
                

                
<TotalFormat Level="0" Axis="Rows" TotalFunction="NoCalculation" SortOrder="Ascending"></TotalFormat>
                

                
            </telerik:PivotGridAggregateField>
        </Fields>

      

           
        <ClientSettings>
       
        </ClientSettings>

    function GridCellSelected(sender, args) {


        var columnName = args.get_column().get_uniqueName();

        var rowheader = args.get_gridDataItem().getDataKeyValue("[---------CLINS----------]");

        var row = args.get_gridDataItem().get_cell(columnName);

        var row_data = row.innerHTML;


        var cellInfo = rowheader.substring(0, 6) + "," + columnName + "##Data=  " + row_data + "!";


        var new_amount = window.prompt("Change Dollar amount: ", row_data);

        var result = PageMethods.Change_Funding_FROM_RadGrid(cellInfo, new_amount, onSucess, onError);


        function onSucess(result) {
            
            rload();           
            //alert(result + "-Click Blue Refresh Button to view Changes" + prev_value + "to" + new_amount);
            
            return;
           
        }

        function onError(result) {
            window.alert('ERROR [' + result);
        }

        function rload() {
       
            var tbl = $find("<%= RadPivotGrid1.ClientID%>") ;
            var master = tbl.get_masterTableView();
            master.rebind();
            location.reload();
           
        }

    }


    </script>


</asp:Content>







1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 12 Dec 2014, 07:26 AM
Hello Keith,

The client object for RadPivotGrid does not have a method get_masterTableView(). This method is available for RadGrid only. 

From the provided code snippet it not clear enough what is your exact scenario and what could cause this issue. Can you please provide the real markup of your page, because I have noticed that your RadPivotGrid definition is within a script tag, which is not valid and I assume that it was a mistake with copy/pasting the code.

I would also like to suggest that you place the following in the same context as your current scripts and see if the client object will be found:
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function pageLoad() {
            var tbl = $find("<%= RadPivotGrid1.ClientID%>");
            alert tbl;
        }
    </script>
</telerik:RadCodeBlock>


Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
PivotGrid
Asked by
Keith
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or