jqgrid xml generating empty cell
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: 开发者_JAVA技巧<cell1></cell1>
)
while generating it ?
Thank's In Advance.
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.
精彩评论