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
1085
Hiding columns breaks addRow
posted

We have a grid that has columns that are shown or hidden based on other circumstances in the form the grid resides on.

Once we hide a column using the hideColumn method of igGrid, addRow fails with the following javascript exception:

"Unable to get value of the property 'replace': object is null or undefined"

I tracked the problem down to the hiding of the column: when the column is hidden, the rowTemplate is rewritten to only contain the visible columns. However, when the tmap is reinitialized from _renderTemplatedCell, the initialization code does not skip any columns, hidden or otherwise.

Assume that we start with 3 columns: ColumnA, ColumnB, and ColumnC. In this case the tmap looks like

ColumnA = {{html ColumnA}}

ColumnB = {{html ColumnB}}

ColumnC = {{html ColumnC}}

If we then hide ColumnB, however, the tmap now looks like:

ColumnA = {{html ColumnA}}

ColumnB = {{html ColumnC}}

since _InitializeTmap did not skip over any hidden columns, but the rowTemplate generated by _setHidden excluded all hidden columns. Therefore, there is now a mismatch between the two.

I tried accounting for this by adding code to skip the hidden columns, but the problem is that the logic that hides hidden cells from the rowTemplate is not applied when there are initial hidden columns in _renderData.

So it seems like there are a couple of fixes that need to be applied here.

Parents
No Data
Reply
  • 17559
    posted

    Hello Karl,

     

    I tried to reproduce the issue that you mentioned in a small test sample. Still on my side everything seems to work as expected. Could you please take a look at the attached sample and modify it in order to suit your scenario.

    Also please check if you are using the same versions of jQuery and jQueryUI and the Infragistics scripts.

     

    Thanks in advance.

    hideColumnAddRow.zip
Children