Dynamically generated grid controll

Hi,

I need to use a grid as a view to a database (‘json’ data). This means that the coulums and rows are generated dynamically. In a list controll I would call $$(id).refresh() to update the controll. In the grid controll I have the problem, that the coloums (fields property) json array and rows (data property) json array is changing dynamically. This means the grid has to be repainted (coloums and rows) every new database result.

I´ve tried to do this with the $$(id).destructor and regenerate, but (because of container) the “old” grid will not be removed from the DIV element and the new one is pasted below :frowning:

So I used global vars for data property and fields property and refill them every database call. But when I call refresh() or something else, nothing happens to the empty grid…

Thank you for your great support

Try to use the next

$(‘grid’).clearAll(); //delete old data
$(‘grid’).define(“fields”,[ //set new configuration
… new columns configuration …
]);
$(‘grid’).load(“new_data_url”); //load new data

as result after new data loading, grid will be repainted with new configuration
if it still not works - try to update the js file from here - viewtopic.php?f=22&t=17736