开发者

jqgrid xml generating empty cell

开发者 https://www.devze.com 2023-02-08 16:47 出处:网络
I\'m using this code to generate xml from my jqgrid\'s data: var grid =$(\"#gridTable\"); var dataFromGrid = grid.jqGrid (\'getRowData\');

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消