The dhtmlxgrid documentation is saying that I should be able to get a string with the grid data with the serialize feature.
Is there any way to get the current data out of the dhtmlx grid to be able to create my own xml file from it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here are answers about the dhtmlxgrid that might be useful to anyone looking for a grid with a flexible API and one that isn’t hardcoded for databases. I needed something to support XML data storage. I looked at several grids and this one was the one with the most straightforward API while having the flexibility for adding data to the grid and for extracting data from the grid. Also, it has all the expected functionality without additional coding: hidden columns, sorting, drag-and-drop…, and many others that I haven’t tested: filtering, context menu. It doesn’t seem to have an edit details popup but this can easily be added with the provided methods.
The serialize methods in dhtmlxgrid do return a text string with the current grid contents. The method .serialize() returns and XML string (with the dhtmlxgrid specific structure) and the .serializeToCSV() returns a csv string. There are options for specifying delimiters.
The dhtmlxgrid does have a data processor for linking to databases. But it also has methods for manually working with the data, particularly if you have a text file or XML storage. These are methods in the dhtmlxgrid which are useful for adding data into the grid and for extract data from the grid:
Adding data to the grid
◦ url – url to the external file;
◦ call – callback function after loading; optional parameter, can be omitted;
◦ type – type of data (xml,csv,json,jsarray); optional parameter; xml by default.
For these methods the documentation can be found at dhtmlx grid load data documentation.
Extracting data from the grid
The documentation for these methods can be found at dhtmlxgrid serialize documentation .
API
The grid documentation can be found here. You will find there a TOC of all the grid features with links to the API (listed alphabetically or categorized).
Samples
The samples can be found here. You might have to look through a few samples to find the one that covers your specific situation. Usually they will have something useful. A sample on row and column manipulation illustrates the use of the API for a grid.
Since a lot of research went into finding something with that set of functionality, I thought I’d make that information available here.