I am trying to populate a DHTMLX grid with delimited data from a web service.
I have tried both:
.load(url,“csv”)
and I have tried accessing the service and storing the data in a variable s and using this:
.parse(s,“csv”)
In both case, the rows are created and the grid can scroll, but none of the data is being displayed.
To make sure that it was not an issue with the data, I assigned the variable s to a manually entered string and I am experiencing the same result.
This is the code where I define the grid. This section is not visible at startup and is later attached to layout when a link in an accordion object is clicked.
<div id="divGroupUpdateUsers" style="display: none;">
<center><b>UPDATE USERS</b><BR><BR>
<div id="divGroupUpdateUsersGrid" style="width:700; height:400px; background-color: white;"></div>
</center>
</div>
<script>
//Grid for the user edit function under Group Functions
UserGrid = new dhtmlXGridObject('divGroupUpdateUsersGrid');
UserGrid.setImagePath("../dhtmlx/dhtmlxgrid/codebase/imgs/");//path to images required by grid
UserGrid.setHeader("Last Name,First Name,Email,Phone,Fax,Address");//set column names
UserGrid.setInitWidths("125,125,100,100,100,150");//set column width in px
UserGrid.setColAlign("left,left,left,left,left,left");//set column values align
UserGrid.setColSorting("str,str,str,str,str,str");//set sorting
UserGrid.init();//initialize grid
UserGrid.setSkin("dhx_skyblue");//set grid skin
UserGrid.csv.cell = "|"
</script>
The code that is supposed to display the data is:
function Group_UpdateUsers_Show()
{
dhxLayout.cells("b").detachObject();
dhxLayout.cells("b").attachObject("divGroupUpdateUsers");
var url="admin.exe?FUNCTION=ListClientContacts&SESSIONID=12345678901234567890123456789012&COMPID=1064&FORMAT=CSV"
UserGrid.clearAll();
//UserGrid.load(url,"csv");
var o = dhtmlxAjax.getSync(url);
var s = o.xmlDoc.responseText;
UserGrid.parse(s,"csv")
}
The load statement is commented out because I changed to getting the data and storing it in a variable so I could display a message box with the variable data and it is definitely returning data delimited with the | character. I have also tried using the comma as the cell separator and the results are the same.
Does anyone have an idea as to what the issue may be?