jQuery UI Widgets › Forums › Grid › Nestable Grid – selectedrowindexes not workin for chid grid
Tagged: nested grid, selectedrowindexes
This topic contains 2 replies, has 2 voices, and was last updated by Hristo 4 years, 11 months ago.
-
Author
-
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 ?
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%’ }
]
});Hello Abhishek Adekar,
You could use the
div
element in therowdetailstemplate
object as a wrapper (parent) in which you could add a newdiv
element.
The new element you could add with your ownid
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 HristovjQWidgets team
https://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.