Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
Uncaught TypeError: Cannot read property '_expandendnoevents' of undefined
posted

Dear support team!

I using component igHierarchicalGrid have problem 

+ Auto collapse records has been expand when I scrolling down.

+ Not expand with records >25 and display error "Uncaught TypeError: Cannot read property '_expandendnoevents' of undefined"

More detail see gif image : "https://s2.gifyu.com/images/Error_expan_table.gif"

Code call generate table :

$("#igGridLog").igHierarchicalGrid({
width: "100%",
height: "calc(100% - 15px)",
dataSource: listLogBasicInfor,
features: [
{
name: "Tooltips",
inherit: true
},
{
name: "Responsive",
enableVerticalRendering: false
},
{
name: "Resizing",
deferredResizing: false,
allowDoubleClickToResize: true,
inherit: true
},
{
name: "Sorting",
inherit: false
},
{
name: "Paging",
pageSize: 100,
type: "local",
inherit: true
},
{
name: "Filtering",
type: "local",
filterDropDownItemIcons: false,
filterDropDownWidth: 200,
filterDialogHeight : "390px",
filterDialogWidth : "515px",
columnSettings: [
{ columnKey: "parentKey", allowFiltering: false },
{ columnKey: "operationId", allowFiltering: false }
]
}
],
autoGenerateColumns: false,
primaryKey: "parentKey",
hidePrimaryKey: true,
columns: self.columnsIgGrid(),
autoGenerateLayouts: false,
rowVirtualization: true,
virtualization: true,
virtualizationMode: 'continuous',
columnLayouts: [
{
width: "100%",
childrenDataProperty: "lstLogDataCorrectRecordRefeDto",
hidePrimaryKey: true,
autoGenerateColumns: false,
primaryKey: "childrentKey",
foreignKey: "operationId",
columns: [
{ key: "childrentKey", headerText: "", dataType: "string", hidden: true },
{ key: "targetDate", headerText: "targetDate", dataType: "string", width: "170px" },
{ key: "itemName", headerText: "itemName", dataType: "string", width: "170px", formatter: _.escape },
{ key: "valueBefore", headerText: "valueBefore", dataType: "string", width: "170px", formatter: _.escape },
{ key: "valueAfter", headerText: "valueAfter", dataType: "string", width: "170px", formatter: _.escape },
{ key: "correctionAttr", headerText: "correctionAttr", dataType: "string", width: "170px" }
],
features: [

{
name: 'Selection',
multipleSelection: false
},
{
name: "Responsive",
enableVerticalRendering: false,
columnSettings: []
}

]
}
],
});

+ Event when expand

$(document).delegate("#igGridLog", "igchildgridcreated", function(evt, ui) {
var headerSetting = $(ui.element).data("headersetting");
var header = ui.element.find("th[role='columnheader']");
for (var i = 0; i < headerSetting.length; i++) {
var currentSetting = headerSetting[i];
header.filter("th[aria-label='" + currentSetting.key + "']")
.find(".ui-iggrid-headertext").text(currentSetting.headerText)
}
});

$(document).delegate("#igGridLog", "igchildgridcreating", function(evt, ui) {
evt;
var childSource = ui.options.dataSource;
var ds = $("#igGridLog").igGrid("option", "dataSource");
var parentSource = _.isArray(ds) ? ds : ds._data;
var headerSetting = [];
var newSource = [];
if (childSource.length > 0) {
for (var i = 0; i < parentSource.length; i++) {
if (parentSource[i].parentKey === childSource[0].parentKey) {
headerSetting = parentSource[i].subColumnsHeaders;
newSource = _.cloneDeep(parentSource[i].lstLogPerCateCorrectRecordDto);
}
}
ui.options.dataSource = newSource;
$(ui.element).data("headersetting", headerSetting);
}
});

Please help me to fixed it

Thank you

Parents
  • 200
    Offline posted

    Hello,
    Thank you for contacting Infragistics.
    After looking into the grid configuration you are using I noticed that you have set the virtualization
    option of the hierarchical grid to true.
    When using virtualization in igHierarchicalGrid the expanded rows cannot be preserved between virtualization frames. There is a known issue in our docs about this.
    We suggest that you set virtualization to false (or remove the options related to the virtualization).
    We also suspect that the JavaScript error is related to the virtualization, so when you turn it off you should not see the error anymore.

    In case you have additional questions feel free to ask them.

Reply Children
  • 200
    Offline posted in reply to tv thuong

    Hello,

    By design the default mode of the Filtering is 'simple' for non-virtualized grids, and 'advanced' when virtualization is enabled. What you are experiencing is that the filtering’s mode changes and it becomes simple which adds placeholders with filtering conditions.

    In order to set the mode to ‘advanced’ add mode: 'advanced' to the Filtering feature object.

    features: [
    
       {
    
           name: "Filtering",
    
          mode: 'advanced'
    
       }
    
    ],
    

    In case you have additional questions don’t hesitate to ask them.