Headers overriden by the ajax load

Hi :slight_smile:

I come to you because i will like your opinion for this problem (for me it’s a problem ^^)

When i do this :

grid1 = new dhtmlXGridObject("grid1");
grid1.setHeader("Title,Description");
grid1.setInitWidths("*,*");
grid1.setColAlign("left,left");
grid1.setColTypes("ro,ro");
grid1.setColSorting("na,na");
grid1.init();
grid1.load("/app_dev.php/load");

The columns headers are overriden with the keys of data to the ajax request.
It’s not really a good behavior i think no ?
It’s not possible to map Headers setted with keys of data ?

Something like this : (the solution is not that but it’s for comprehension)

grid1 = new dhtmlXGridObject("grid1");
grid1.setHeader({name:'Title', desc:'Description'});
....

Ty in advance for all contributer :wink:

The columns headers are overriden with the keys of data to the ajax request.
Unfortunately your issue is not clear. Using the setHeader() method you define the titles of the columns in your header.
Could you clarify how it is get overridden with the ajax load? If you define your header in the incoming data there is no need to call the setHeader() method.

Please, provide with a more detailed sample of your code with the example of the incoming data.

First Ty for your reply

For more precision i think that if we initialize the grid in javascript with the config of columns, the response of ajax request shouldn’t have the another config for the columns. Why override the default settings ? I fixed my problem by stopping to configure the headers in javascript and i configured their in response of ajax (with grid connector).

But i think it’s not the solution for all and for me but i did like that.

think that if we initialize the grid in javascript with the config of columns, the response of ajax request shouldn’t have the another config for the columns.
it’s right. So I can’t see how your ajax call override your header.
Could you clarify your issue with the using code.