Reputation: 3050
I'm using this code to generate xml from my jqgrid's data:
var grid = $("#gridTable");
var dataFromGrid = grid.jqGrid ('getRowData');
var xml_string = '<rows>\n' + xmlJsonClass.json2xml ({rowTest:dataFromGrid}, '\t') +
'</rows>';
when the cell inside the grid is empty i get inside the xml tag "_EMPTY_STRING" ,
how can i change it to be just empty xml tag (like this: <cell1></cell1>
)
while generating it ?
Thank's In Advance.
Upvotes: 1
Views: 302
Reputation: 221997
The most easy way to do this is just to append your code with the following line
xml_string = xml_string.replace(/>__EMPTY_STRING_<\//g, "><\/");
It will cut all __EMPTY_STRING_
strings.
Upvotes: 2