jQuery UI Widgets Forums Grid Nestable Grid – selectedrowindexes not workin for chid grid

This topic contains 2 replies, has 2 voices, and was last updated by  Hristo 4 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • Abhishek Adekar
    Participant

    hi,

    i am using nestable grid, both are having |selectionmode: ‘checkbox’|

    when using $(‘#jqxgrid’).jqxGrid(‘selectedrowindexes’);

    i only get indexes for parent grid and not for nested (child) grid.

    how to get selectedindex of nested grids ?


    Abhishek Adekar
    Participant

    Posting code :

    var data = JSON.parse(investorsJsonData);
    var source =
    {
    datafields: [
    {name: ‘investorName’, type: ‘string’},
    {name: ‘entityType’, type: ‘string’},
    {name: ‘kycStatus’, type: ‘string’},
    ],
    datatype: ‘json’,
    localdata: data
    };
    var adapter = new $.jqx.dataAdapter(source);

    // create nested grid.
    var initrowdetails = function (index, parentElement, gridElement, record) {
    var id = record.uid.toString();
    var grid = $($(parentElement).children()[0]);
    nestedGrids.push(grid);
    var nestedSource =
    {
    datafields: [
    {name: ‘relatedPartyName’, type: ‘string’ },
    {name: ‘relatedPartyType’, type: ‘string’ },
    {name: ‘rpKycStatus’, type: ‘string’ }
    ],
    datatype: ‘json’,
    root: ‘relatedParty’,
    selectionmode: ‘checkbox’,
    editable: false,
    localdata: data[index].relatedParties
    };
    var nestedAdapter = new $.jqx.dataAdapter(nestedSource);
    if (grid != null) {
    grid.jqxGrid({
    source: nestedAdapter,
    width: ‘90%’,
    height: 350,
    selectionmode: ‘checkbox’,
    columns: [
    { text: “Related Party Name”, datafield: “relatedPartyName”, editable:false, width: ‘38%’ },
    { text: “Related Party Type”, datafield: “relatedPartyType”, editable:false, width: ‘30%’ },
    { text: “KYC Status”, datafield: “rpKycStatus” , editable:false, width: ‘30%’}

    ]
    });
    }
    }
    // creage jqxgrid
    $(“#investorMappingJqxgrid”).jqxGrid(
    {
    width: ‘100%’,
    height: 300,
    source: source,
    rowdetails: true,
    rowsheight: 35,
    selectionmode: ‘checkbox’,
    editable: false,
    filterable: true,
    showfilterrow: true,
    initrowdetails: initrowdetails,
    rowdetailstemplate: { rowdetails: “<div id=’grid’ style=’margin: 10px;’></div>”, rowdetailsheight: 220, rowdetailshidden: true },
    ready: function () {
    //$(“#jqxgrid”).jqxGrid(‘showrowdetails’, 0);
    },
    columns: [
    { text: ‘Investor Name’, datafield: ‘investorName’, editable:false , width: ‘38%’ },
    { text: ‘Entity Type’, datafield: ‘entityType’, editable:false , width: ‘30%’ },
    { text: ‘KYC Status’, datafield: ‘kycStatus’, editable:false , width: ‘30%’ }
    ]
    });


    Hristo
    Participant

    Hello Abhishek Adekar,

    You could use the div element in the rowdetailstemplate object as a wrapper (parent) in which you could add a new div element.
    The new element you could add with your own id attribute.

    Or you could use another approach to determinate after the initialization.
    Please, take a look at this article:
    https://www.jqwidgets.com/assembling-n-nested-jquery-grid/
    I hope this will help.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.