As stated, my grid doesn’t get populated with data, only the table headers show up.
<div class="modal">
...
<div class="import-configuration-status-grid" id="import-configuration-status-grid"></div>
...
</div>
<script type="text/javascript">
var importConfigurationStatusGrid = new dhtmlXGridObject('import-configuration-status-grid');
</script>
<script type="text/javascript">
function displayImportConfigurationStatus(result) {
importConfigurationStatusGrid.setHeader("Error name, Filename");
importConfigurationStatusGrid.setColAlign("right,left");
importConfigurationStatusGrid.setColTypes("ro, ro");
importConfigurationStatusGrid.setColSorting("str,str");
importConfigurationStatusGrid.enableResizing("false, false");
importConfigurationStatusGrid.init();
importConfigurationStatusGrid.parse(JSON.stringify(result), "json"); // also tried "js" instead of "json"
}
$.ajax({
url: formURL,
type: 'POST',
data: new FormData($('form')[0]),
cache: false,
processData: false,
contentType: false,
success: function (result) {
// once I get the response, I display the result in the grid
displayImportConfigurationStatus(result);
},
error: function (xhr, ajaxOptions, thrownError) {
}
});
</script>
// the response looks like this:
{“rows”:{“Conflicting”:[“TASK_SPEC/UserTask_1z12qfq.json”]}}
I also tried the example posted in the following link: https://docs.dhtmlx.com/grid__basic_initialization.html with following modifications:
function displayImportConfigurationStatus(result) {
importConfigurationStatusGrid.setHeader("Error name, Filename");
importConfigurationStatusGrid.setColAlign("right,left");
importConfigurationStatusGrid.setColTypes("ro, ro");
importConfigurationStatusGrid.setColSorting("str,str");
importConfigurationStatusGrid.enableResizing("false, false");
importConfigurationStatusGrid.init();
data = {
rows:[
{data : ["Foo", "Bar"]},
{data : ["Foo", "Bar"]},
{data : ["Foo", "Bar"]}
]
};
importConfigurationStatusGrid.parse(data, "json");
}
But then I get the following error:
Uncaught TypeError: xml.getElementsByTagName is not a function