telerik how to fill the power grid on the row of another grid



  • Good afternoon,

    Maybe someone who's confronted and told me.

    There are two telerik grids on the page, you need to press on the line of the first grid. Update the second data from the request to OBD. Accordingly, I have been able to capture the event of compression of the required line, take it id and transfer it to the controll to form a request to the OBD to display the necessary information on the second grid.

    But I don't understand how I got json's results from my controll as a new data source for the second grid, and update it.

    Tell me who you've been through, thank you!

    <!-- language: lang-js -->
    

    <script type="text/javascript">
    function onButtonClick(e) {
    e.preventDefault();
    var grid = $("#grid1").data("kendoGrid");
    var selectedItem = grid.dataItem(grid.select());
    $.ajax({
    url: "/myControll/ReadDataMethod",
    type: "GET",
    data: { id: selectedItem.Id}
    }).done(function(returnData) {
    $("#grid2").data("kendoGrid").dataSource.data(returnData);
    $("#grid2").data("kendoGrid").dataSource.read();
    });
    }
    </script>


  • QA Engineer

    The decision is next!

    At the event of the first grid line, we fill the hidden fields of our variables, which will be transferred to the control and the read method of the second grid.

    <input type="hidden" id="HiInIncId" value=""/>
    <input type="hidden" id="HiInIncNum" value="" />
    

    <script type="text/javascript">
    function onChange(e) {
    var grid = $("#grid").data("kendoGrid");
    var selectedItem = grid.dataItem(grid.select());

        $('input[id=HiInIncId]').val(selectedItem.Id);
        $('input[id=HiInIncNum]').val(selectedItem.IncidentID);
    
        $("#gridInc").data("kendoGrid").dataSource.read();
    }
    

    </script>

    In the second grid, we're pointing out Data (extraDataInc) to challenge the violin of our variables to the counter.

    Read(action => action.Action("ReadIncident", "DetailInc").Data("extraDataInc")).

    <script type="text/javascript">
    function extraDataInc(e) {
    return {
    someDate: $('#someDate').val(),
    incid: $('input[id=HiInIncId]').val(),
    incnum: $('input[id=HiInIncNum]').val()
    }
    }
    </script>




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2