Reloading grid after deleting colums does not work

here is the issue:

I trying to set the number of colums in my grid “manually” calling an xajax method.

Here is the procedere:

  • First run:
  1. define the grid with one column
  2. Initialize the grid
  3. adding some Rows to the grid
  4. Load data from xml within an textarea

This works perfect.

The problemn occurrs when I try to reload new data to the grid. Here is the way I tryed to realize the reload with basically the same procedere like in the first run:

  • second run:
  1. myGrid.clearAll()
  2. delete all columns but the first one (to keep the first column, the grid was initialized with)
  3. adding some Rows to the grid
  4. Load data from xml in an textarea

Columns are properly deleted and new columns are added. But loading the data into the grid does not work. Steps 3 and 4 are identical in first and second run. Data are properly written into the textarea and it is not a problem of wrong Row id’s

Any Idea???

Unfortunately your issue is not clear.
After the First run you’ll get only one column in your grid so it is not clear what columns are you removing in the second run.
Please, clarify your steps with the using code.

Hi,

I am having a similar problem. This is what I am doing:

  • Initialize grid with 4 columns.
  • Load an XML with data to populate those four columns.
  • … Here everything works fine.
  • Delete second column of the grid.
  • Clear the grid.
  • Load an XML with data to populate only three columns. (i.e., only three cell nodes per row node)
  • … Here dhtmlxGrid will complain and no data is rendered.

However, after deleting the second column, if I load the original XML that populates all original four columns, the grid renders the data correctly.

In fact, IMHO, deleteColumn works as an alias of hideColumn, because grid is expecting an XML with the same number of columns as if no column were deleted but only hidden, and is skipping those columns that were “deleted”.

This is forcing me into destroying the grid and rebuilding it from scratch when data is reloaded. So… The dynamic behaviour of adding/deleting columns from the grid appears to be broken.

I am attaching a demo code I am using, along the XML files that populates the grid. I hope I am doing something wrong. It would be better to have the dynamism described in the insert/deleteColumn methods.
grid_add_del_col.zip (1.15 KB)

I apologize for the delay.
The issue is confirmed we’re working on it.

Hi,

Any update on this issue? I am still facing the same problem. I delete column then I reload grid, I got “Uncaught TypeError: Cannot read property ‘indexOf’ of null” javascript error.